Module:Variants: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Only show the variant name and do not repeat the variant category name) |
(Do not error when Variant name isn't defined) |
||
Line 37: | Line 37: | ||
local formatted = {} |
local formatted = {} |
||
for _, entry in ipairs(smw_data) do |
for _, entry in ipairs(smw_data) do |
||
if entry['Variant name'] then |
|||
local |
local page = entry[1] |
||
local pipe = page:find('|') |
|||
if pipe then |
|||
⚫ | |||
else |
|||
⚫ | |||
page = page:sub(3, -3) |
|||
end |
end |
||
table.insert(formatted, ('[[%s|%s]]'):format(page, entry['Variant name'])) |
table.insert(formatted, ('[[%s|%s]]'):format(page, entry['Variant name'])) |
||
else |
|||
table.insert(formatted, entry[1]) |
|||
end |
|||
end |
end |
||
contents = table.concat(formatted, ' • ') |
contents = table.concat(formatted, ' • ') |