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〉', '%]'):gsub( '</?nowiki%s*/?%s*>','')  
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( '<', '&lt;' ):gsub( '&lt;(!%-%- /?Command %-%->)','<%1')
result = result:gsub( '<', '&lt;' ):gsub( '&lt;(!%-%- Command %-%->)&lt;','<%1<'):gsub( '&lt;/code>&lt;(!%-%- /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