Module:Color: Difference between revisions
From Zelda Wiki, the Zelda encyclopedia
m
support any valid HTML color on talk pages and such
PhantomCaleb (talk | contribs) (Add E to list of colors) |
PhantomCaleb (talk | contribs) m (support any valid HTML color on talk pages and such) |
||
Line 21: | Line 21: | ||
function p.color(colorId, text) | function p.color(colorId, text) | ||
local colorData = data.colors[colorId] | local colorData = data.colors[colorId] | ||
-- Backwards compatibility for inputting | -- Backwards compatibility for inputting any valid HTML color | ||
-- | -- In articles we should only allow defined game colors, but we can keep support for any HTML color on user and talk pages to avoid breaking user signatures that use the template this way | ||
if colorData == nil | if colorData == nil and (mw.title.getCurrentTitle().isTalkPage or mw.title.getCurrentTitle().nsText == "User") then | ||
html = mw.html.create("span") | html = mw.html.create("span") | ||
:css("color", colorId) | :css("color", colorId) |