Module:Inventory slot/Aliases/Table: Difference between revisions

Well it's not that slow, but the table is still ridiculously large. Doesn't seem worth having.
Combine Any/Matching alias rows
Line 8: Line 8:
-- Skip the banner aliases (except "Any Banner"), as there are so
-- Skip the banner aliases (except "Any Banner"), as there are so
-- many of them it causes the table to be excessively long
-- many of them it causes the table to be excessively long
if i == 'Any Banner' or not i:find( ' Banner$' ) then
if i == 'Any Banner' or not i:find( ' Banner$' ) and not i:find( '^Matching ' ) then
table.insert( keys, i )
table.insert( keys, i )
end
end
Line 28: Line 28:
end
end
table.insert( tableRows, '|<code>' .. key .. '</code>||' .. table.concat( displayCell ) )
local aliasText = mw.html.create()
aliasText:tag( 'code' ):wikitext( key )
if key:find( '^Any ' ) then
aliasText:tag( 'br' ):done()
:tag( 'code' ):wikitext( ( key:gsub( '^Any', 'Matching' ) ) )
end
table.insert( tableRows, '|' .. tostring( aliasText ) .. '||' .. table.concat( displayCell ) )
end
end
table.insert( tableRows, '|}' )
table.insert( tableRows, '|}' )