Module:Lang: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Fixed issue with coloring of spirit icon |
No edit summary |
||
| Line 37: | Line 37: | ||
local function process_html_tags(text, frame) | local function process_html_tags(text, frame) | ||
if not text or type(text) ~= "string" then return text end | if not text or type(text) ~= "string" then return text end | ||
local replacements = { | |||
SpiritIcon = '{{Icon/Purple|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', | |||
text = text:gsub('<span class="highlight">(.-)</span>', " | SpiritDamage = '{{Icon/Purple|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}<span style="color:#bc8ee8;font-weight: bold;">spirit damage</span>', | ||
FireRate = '{{Icon/Grey|[[File:Fire_Rate.png|link=Fire Rate|20px]]}}<span style="color:#ffefd7;font-weight: bold;">fire rate</span>', | |||
MeleeDamage = '{{Icon/Brown|[[File:Melee damage.png|link=Melee Damage|20px]]}}<span style="font-weight: bold;">melee damage</span>', | |||
WeaponDamage = '{{Icon/Brown|[[File:Damage.png|link=Weapon Damage|20px]]}}<span style="color:#ec981a;font-weight: bold;">weapon damage</span>' | |||
} | |||
-- Process citadel_inline_attribute tags | |||
text = text:gsub("{g:citadel_inline_attribute:'(.-)'}", function(key) | |||
if replacements[key] then | |||
return replacements[key] | |||
else | |||
return '<span style="color:red;font-weight:bold;border-bottom:1px dotted red;" title="Missing attribute definition - Add \''..key..'\' to local replacements in [Module:Lang]">['..key..']</span>' | |||
end | |||
end) | |||
-- Process HTML spans | |||
text = text:gsub('<span class="highlight">(.-)</span>', "<span style= font-weight:bold>%1</span>") | |||
text = text:gsub('<span class="diminish">(.-)</span>', '<span style="color:#777777">%1</span>') | text = text:gsub('<span class="diminish">(.-)</span>', '<span style="color:#777777">%1</span>') | ||
text = text:gsub('<span class=".-">(.-)</span>', '%1') | text = text:gsub('<span class=".-">(.-)</span>', '%1') | ||