10,731
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary |
||
Line 108: | Line 108: | ||
else | else | ||
local function glossary(form, colour) | local function glossary(form, colour) | ||
if data[form] then | if mw.ustring.sub(form, 1, 1) == "_" then | ||
return mw.ustring.sub(form, 2) | |||
else | |||
if data[form] then | |||
form = data[form].label | |||
if colour == nil then colour = data[form].colour end | |||
end | |||
local to_Return = "''[[Appendix:Glossary#" .. form .. "|" .. form .. "]]''" | |||
if colour then | |||
to_Return = "<span style=\"background-color: #" .. colour .. ";\">" .. to_Return .. "</span>" | |||
end | |||
return to_Return | |||
end | end | ||
end | end | ||
local temp_main = "" | local temp_main = "" | ||
Line 123: | Line 127: | ||
end | end | ||
local form, colour | local form, colour | ||
if mw.ustring.find(temp, "^%:[^%(%<%[%+%/]+") then | if mw.ustring.find(temp, "^%:[^%(%<%[%+%/%:]+") then | ||
local link = mw.ustring.match(temp, "^%:([^%(%<%[%+%/]+)") | while mw.ustring.find(temp, "^%:[^%(%<%[%+%/%:]+") do | ||
local link = mw.ustring.match(temp, "^%:([^%(%<%[%+%/%:]+)") | |||
link = mw.ustring.gsub(link, "%s+$", "") | |||
temp_append("'''" .. m_links.full_link{language = language, term = link} .. "'''") | |||
remove_temp("^%:[^%(%<%[%+%/%:]+") | |||
end | |||
if mw.ustring.find(temp, "^%([^%)]+%)") then | if mw.ustring.find(temp, "^%([^%)]+%)") then | ||
form = mw.ustring.match(temp, "^%(([^%)]+)%)") | form = mw.ustring.match(temp, "^%(([^%)]+)%)") |