Module:Command: Difference between revisions

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