Module:ColorParse: Difference between revisions

4 bytes removed ,  17:40, 17 September 2019
m
standardized what linebreak to use
(cleaned up my very first lua module into something actually legible. also, now properly preserves whitespace if there is is a space between the color code and the actual text)
m (standardized what linebreak to use)
Line 29: Line 29:
     b = string.gsub(b,"([{}])", "")
     b = string.gsub(b,"([{}])", "")
   elseif type == 'notxml' then
   elseif type == 'notxml' then
     b = string.gsub(b,"(\\n)","</br>")
     b = string.gsub(b,"(\\n)","\n")
   end
   end
   return b
   return b
Line 35: Line 35:




function linebreaks(frame)
function p.linebreaks(frame)
   local b = string.gsub(frame.args[1],"(~)","</br>")
   local b = string.gsub(frame.args[1],"(~)","\n")
   return b
   return b
end
end