Module:ColorParse: Difference between revisions

89 bytes added ,  18:42, 3 August 2019
allowed a second argument: if 'no linebreak parse' it will not replace all new line with html <br>s
(fixed new line bug)
(allowed a second argument: if 'no linebreak parse' it will not replace all new line with html <br>s)
Line 28: Line 28:
         return "<span style=\"color: " .. luatable[color] .. ";\">"  .. text .. "</span>"
         return "<span style=\"color: " .. luatable[color] .. ";\">"  .. text .. "</span>"
     end)
     end)
local c = string.gsub(a,"(\n)", "</br>")
local c
if frame.args[2] ~= nil and frame.args[2] == 'no linebreak parse' then
c = string.gsub(a,"(\n)", "</br>")
else
c = a
end
return c
return c
end
end