Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) No edit summary |
||
Line 4:
local p = {}
local function
local title = mw.title.new(country)▼
if not title or not title.exists then▼
return country▼
end
return '[[' .. country .. ']]'▼
end▼
local function getTimespan(timespan)
return ' (' .. timespan .. ')'
local function getImage(image)
local file = nil
if string.match(image, ".-%.") then
file =
elseif string.match(image, ".-%s%(.-%)") then
local country, var = string.match(image,"(.-)%s%((.-)%)")
file =
else
file =
end
return file
▲end
country = string.match(country, "(.-)%+")▼
▲ end
▲ local title = mw.title.new(country)
▲ if not title or not title.exists then
▲ return country
end▼
▲ return '[[' .. country .. ']]'
end
Line 43 ⟶ 39:
local i = 1
local country, timespan, image
image = getImage(frame, args[i])▼
for line in args[i]:gmatch('[^\n]+') do
line = mw.text.trim(line)
local key, val = line:match('^([a-z]*):? *(.*)$')
elseif key == 'date' then
timespan = getTimespan(val)
elseif key == 'flag' then
else
return require('Module:Error').error{'
end
if not country then
return require('Module:Error').error{'A country is required in argument ' .. i}
if not timespan then
return require('Module:Error').error{'A date is required in argument ' .. i}
end
table.insert(entries, {
timespan = timespan,
image = image,
▲ country = getCountry(args[i]),
})
Line 56 ⟶ 76:
end
i = i +
▲ end
▲ if args[i] then
▲ return require('Module:Error').error{'Uneven number of parameters, there should be 2 parameters per entry.'}
end
Line 99 ⟶ 115:
['vertical-align'] = 'top'
})
:wikitext(entry.country .. entry.
end
|