Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
re-add extracting color
adjust
Line 81:
end
 
-- extract text color from css, which is the only permitted inline CSS for the navbar
local function extractcolorextract_color(strcss_str)
-- return nil because navbar takes its argument into mw.html which handles
-- nil gracefully, and it removesremoving the associated style attribute
return mw.ustring.match(';' .. strcss_str .. ';', '.*;%s*([Cc][Oo][Ll][Oo][Rr]%s*:%s*.-)%s*;') or nil
end
 
Line 93:
[cfg.navbar.name] = args[cfg.arg.name],
[cfg.navbar.mini] = 1,
[cfg.navbar.fontstyle] = extractcolorextract_color(
(args[cfg.arg.basestyle] or '') .. ';' .. (args[cfg.arg.titlestyle] or '')
)