Module:Command: Difference between revisions
No edit summary |
m well, nowiki can't work properly in modules |
||
| 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〉', '%]') | ||
-- 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 | ||
result = result:gsub( '<', '<' ):gsub( '<(!%-%- / | result = result:gsub( '<', '<' ):gsub( '<(!%-%- Command %-%->)<','<%1<'):gsub( '</code><(!%-%- /Command %-%->)','</code><%1') | ||
end | end | ||
return '<!-- Command --><code ' .. attr .. '>' .. slash .. result .. '</code><!-- /Command -->' | return '<!-- Command --><code ' .. attr .. '>' .. slash .. result .. '</code><!-- /Command -->' | ||
end | end | ||
return p | return p | ||