Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (hide` (episode)` on link)
(Make the icon link to the episode instead of the image itself)
Line 133: Line 133:
if valid_episode then
if valid_episode then
local page_name = valid_episode .. ' (episode)'
local page_name = valid_episode .. ' (episode)'
-- Check if the page with '(episode)' exists
-- Check if the page with '(episode)' exists
if mw.title.new(page_name).exists then
if mw.title.new(page_name).exists then
return '[[File:'..valid_episode..' episode icon.png|18px]] [['..page_name..'|'..valid_episode..']]'
return '[[File:'..valid_episode..' episode icon.png|18px|link='..page_name..']] [['..page_name..'|'..valid_episode..']]'
else
else
-- Fallback to the original episode name
-- Fallback to the original episode name
return '[[File:'..valid_episode..' episode icon.png|18px]] [['..valid_episode..']]'
return '[[File:'..valid_episode..' episode icon.png|18px|link='..valid_episode..']] [['..valid_episode..']]'
end
end
end
end
return nil
return nil
end
end