Module:Sandbox/BrandonXLF/3: Difference between revisions

Content deleted Content added
Undid revision 1052916985 by BrandonXLF (talk)
No edit summary
Line 5:
 
function getImage(frame, image)
if not string.match(image,".-%+.-") then
_, image = string.match(image,"(.-)%+(.-)")
return nil
end
 
Line 24:
 
function getCountry(country)
if string.match(country,".-%+.-") then
country, _ = string.match(image,"(.-)%+(.-)")
end
local title = mw.title.new(country)
Line 39 ⟶ 43:
local i = 1
 
while args[i + 21] do
image = getImage(frame, args[i])
table.insert(entries, {
image = image,
country = getCountry(args[i + 1]),
post = args[i + 21] and ' (' .. args[i + 21] .. ')' or ''
})
Line 52 ⟶ 56:
end
i = i + 32
end