7,038
edits
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
local title = mw.title.new(args[1]) | local title = mw.title.new(args[1]) | ||
local text = title:getContent() | local text = title:getContent() | ||
local games = text and p.extractGames(text) or | local games = text and p.extractGames(text) or "" | ||
local text = {} | local text = {} | ||
local games2 = { "iii", "vc", "sa", "iv" } | local games2 = { "iii", "vc", "sa", "iv" } | ||
local data | local data | ||
games = games:lower() | |||
for i,game in ipairs(games2) do | for i,game in ipairs(games2) do | ||
if | if games:find(game:lower(), 1, false) then | ||
data = frame:expandTemplate{title = "icon-"..game} | data = frame:expandTemplate{title = "icon-"..game} | ||
else | else | ||
| Line 33: | Line 34: | ||
local games = text:match("|%s*games%s*=%s*([^|]+)") | local games = text:match("|%s*games%s*=%s*([^|]+)") | ||
if not games then | if not games then | ||
return | return "iii vc sa iv" | ||
end | end | ||
return games:match("^%s*(.-)%s*$") -- trim | |||
end | end | ||
edits