Module:Command: Difference between revisions
m well, nowiki can't work properly in modules |
mNo edit summary |
||
| Line 58: | Line 58: | ||
if startPos then | if startPos then | ||
params[1] = params[1]:sub( 1, startPos - 1 ) .. | params[1] = params[1]:sub( 1, startPos - 1 ) .. | ||
params[1]:sub( startPos, endPos ):gsub('%[','〈lsqb〉'):gsub('%]','〈rsqb〉'):gsub('{','{'):gsub('}','}'):gsub("'",' | params[1]:sub( startPos, endPos ):gsub('%[','〈lsqb〉'):gsub('%]','〈rsqb〉'):gsub('{','{'):gsub('}','}'):gsub("'",'〈apos〉'):gsub('"','〈quot〉'):gsub( '%s', '〈space〉' ) .. | ||
params[1]:sub( endPos + 1 ) | params[1]:sub( endPos + 1 ) | ||
else | else | ||
| Line 178: | Line 178: | ||
end | end | ||
local result = table.concat( command, ' ' ):gsub( '〈space〉', ' ' ):gsub('〈lsqb〉', '%['):gsub('〈rsqb〉', '%]') | local result = table.concat( command, ' ' ):gsub( '〈space〉', ' ' ):gsub('〈lsqb〉', '%['):gsub('〈rsqb〉', '%]'):gsub('〈apos〉',"'"):gsub('〈quot〉','"') | ||
-- Don't encode if told not to or if there is a sub-command | -- Don't encode if told not to or if there is a sub-command | ||
if args.escape ~= '0' then | if args.escape ~= '0' then | ||