Module:ColorParse: Difference between revisions

55 bytes added ,  20:11, 29 July 2019
fixed bug, added linebreaks method
m (fixed bug)
(fixed bug, added linebreaks method)
Line 4: Line 4:
local b = string.gsub(frame.args[1],"([{}])", "")
local b = string.gsub(frame.args[1],"([{}])", "")
local b = string.gsub(b,"(~J211)", "")
local b = string.gsub(b,"(~J211)", "")
local b = string.gsub(b,"(~)","</br>")
local a = string.gsub(b,"(&amp;)(%w)([^&\n]*)", function(_,color,text)
local a = string.gsub(b,"(&amp;)(%w)([^&\n]*)", function(_,color,text)
         local luatable = {
         local luatable = {
Line 30: Line 29:
     end)
     end)
return a
return a
end
function p.linebreaks(frame)
local b = string.gsub(frame.args[1],"(~)","</br>")
return b
end
end