10,731
edits
TheNightAvl (talk | contribs) m (Added test thing, will remove later) |
TheNightAvl (talk | contribs) mNo edit summary |
||
Line 8: | Line 8: | ||
local alt = data.alt or data.term | local alt = data.alt or data.term | ||
if data.language.proto | if data.language and data.language.proto then | ||
alt = "*" .. alt | |||
link = "Appendix:" .. data.language.name .. "/" .. data.term | |||
elseif data.language then | |||
link = link .. "#" .. string.gsub(data.language.name, " ", "_") | |||
end | |||
if mw.ustring.match(mw.ustring.gsub(link, " ", " "),"([^%#]+)") == mw.title.getCurrentTitle().prefixedText then | |||
alt = "*" .. alt | alt = "*" .. alt | ||
return "<b>" .. alt .. "</b>" | return "<b>" .. alt .. "</b>" | ||
else | |||
else | |||
return "[[" .. link .. "|" .. alt .. "]]" .. mw.title.getCurrentTitle().fragment | return "[[" .. link .. "|" .. alt .. "]]" .. mw.title.getCurrentTitle().fragment | ||
end | end |