7,878
edits
No edit summary |
No edit summary |
||
(47 intermediate revisions by the same user not shown) | |||
Line 39: | Line 39: | ||
-- end | -- end | ||
-- Edited to turn regular links into | -- Edited to turn regular links into links with ' (Vanilla)' at the end and to turn parallel: prefixes into regular links | ||
local link = ( args.link or '' ) | local link = ( args.link or '' ) | ||
if mw.ustring.lower( link ) == 'none' then | if mw.ustring.lower( link ) == 'none' then | ||
Line 45: | Line 45: | ||
elseif link ~= '' then | elseif link ~= '' then | ||
local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or '' | local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or '' | ||
if | if linkPrefix == "parallel:" then -- <- these are the added bits here | ||
linkprefix = '' | linkprefix = '' | ||
end | |||
if string.find(link, "[Pp]arallel:") then | |||
link = mw.ustring.gsub( link, "[Pp]arallel:", "" ) | |||
else | |||
link = link .. ' (Vanilla)' | |||
end | end | ||
link = linkPrefix .. link | link = linkPrefix .. link | ||
Line 105: | Line 110: | ||
spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']' | spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']' | ||
else | else | ||
if string.find(link, " | if string.find(link, " (Vanilla)") then -- <-- this inner if/else statement is added | ||
spriteText = '[[' .. link .. '|' .. tostring( spriteText ):gsub(" (Vanilla)", "") .. ']]' | |||
spriteText = '[[' .. | elseif string.find(tostring(spriteText), "[Pp]arallel:") then | ||
text = tostring(spriteText):gsub(":%l", string.upper) | |||
text = text:gsub("[Pp]arallel:", "") | |||
spriteText = '[[' .. link .. '|' .. text .. ']]' | |||
else | else | ||
spriteText = '[[' .. link | spriteText = '[[' .. link .. '|' .. tostring( spriteText ) .. ']]' | ||
end | end | ||
end | end | ||
end | end |