Module:Param Parse: Difference between revisions
m
no edit summary
No edit summary |
mNo edit summary |
||
Line 4:
-- <nowiki>
local
-- Standardized "has content" function
function
-- Return arg if any non-whitespace character is found
return string.match(arg or '', '%S') and arg or nil
Line 15:
-- Standardized image function
function
if img and img:find('%S') then
return img
Line 21:
return nil
end
function
return string.match(img, "File:.-%.png")
end
Line 27:
-- Standardized numbers
function
num = string.gsub(num or '',',','')
return tonumber(num)
Line 35:
-- Episode
local valid_episodes = {['Hopeport'] = 1, ['Hopeforest'] = 1, ['Mine of Mantuban'] = 1, ['Crenopolis'] = 1}
function
if valid_episodes[episode] then
return '[[File:'..episode..' episode icon.png|18px]] [['..episode..']]'
Line 41:
return nil
end
function
if valid_episodes[episode] then
return episode
Line 48:
end
return
-- </nowiki>
|