Module:Variants: Difference between revisions
Fix link output
(For equiptment with grades, show "Grade N" as the variant name) |
Im Wired In (talk | contribs) (Fix link output) |
||
Line 20:
'?Profession Level B High',
'?Variant name',
'?Version anchor',
'?#-',
get_images and '?Image#64px;x64px = Image' or nil,
limit = args.limit or 500,
Line 40 ⟶ 42:
if variant_name then
local page = entry[1]
if page:sub(1, 1 + #variant_name + #' (grade ') == ':' .. variant_name .. ' (grade ' and page:sub(-1) == ')' then
local grade_number = page:sub(2 + #variant_name + #' (grade ', -2)
Line 52 ⟶ 47:
variant_name = 'Grade ' .. grade_number
end
local anchor = entry['Version anchor'] and ' § ' .. entry['Version anchor'] or ''
table.insert(formatted, ('[[%s|%s%s]]'):format(page, variant_name, anchor))
else
table.insert(formatted, ('[[%s]]'):format(entry[1]))
end
end
contents = table.concat(formatted, '
else
contents = '[[Category:Empty variant list]]'
Line 126 ⟶ 122:
:tag('td')
:css{ ['border-left'] = 'none' }
:wikitext(('[[%s]]'):format(entry[1]))
:done()
:tag('td')
|