Module:ColorParse: Difference between revisions

23 bytes removed ,  15:07, 14 November 2019
(by SublimeText.Mediawiker)
(newline charas are turned into actual newlines regardless of parse type)
imported>Teamtotobot
((by SublimeText.Mediawiker))
Line 6: Line 6:
--[Utility stuff]--
--[Utility stuff]--


function normalize(string, type)
function normalize(input, type)
   type = type or 'xml'
   type = type or 'xml'
   local b = string.gsub(string,"(~J211)", "")
   local b = input:gsub("(~J211)", "")
   b = b:gsub("(%*)", "*")
   b = b:gsub("(%*)", "*")
   if type == 'xml' then
   if type == 'xml' then
     b = string.gsub(b,"([{}])", "")
     b = b:gsub("([{}])", "")
   end
   end
   b = string.gsub(b,"(\\n)","\n")
   b = b:gsub("(\\n)","\n")
   return b
   return b
end
end
Anonymous user