8,756
edits
m (standardized what linebreak to use) |
(if text is empty return just blank) |
||
Line 53: | Line 53: | ||
local b = normalize(frame.args[1],regextype) | local b = normalize(frame.args[1],regextype) | ||
local a = string.gsub(b, regex, function(_,color,space1,text) | local a = string.gsub(b, regex, function(_,color,space1,text) | ||
if text ~=nil and text ~= '' then | |||
local hexcolor = luatable[color] | local hexcolor = luatable[color] | ||
if hexcolor == nil then | if hexcolor == nil then | ||
Line 60: | Line 61: | ||
text = text or "" | text = text or "" | ||
return space1 .. "<span style=\"color: " .. hexcolor .. ";\">" .. text .. "</span>" | return space1 .. "<span style=\"color: " .. hexcolor .. ";\">" .. text .. "</span>" | ||
else | |||
return '' | |||
end | |||
end) | end) | ||
return a | return a |