17,273
edits
(add AoL, LttP, LA to staging. gonna do all four before going live) |
(remove {{Main}} regex since it is always expanded now) |
||
Line 6: | Line 6: | ||
:tag( 'ul' ) | :tag( 'ul' ) | ||
for _, section in ipairs( sections ) do | for _, section in ipairs( sections ) do | ||
-- !!!! This may break if Template:Main is modified !!!! | -- !!!! This may break if Template:Main is modified !!!! | ||
local expandedMainTemplate = section.summary:match( 'Main article: %[%[(.-)]]' ) | local expandedMainTemplate = section.summary:match( 'Main article: %[%[(.-)]]' ) | ||
local link = | local link = expandedMainTemplate and mw.text.split( expandedMainTemplate, '|' )[1] | ||
list:tag( 'li' ) | list:tag( 'li' ) | ||
:wikitext( '[[' .. (link or section.name) .. '|' .. section.name .. ']]' ) | :wikitext( '[[' .. (link or section.name) .. '|' .. section.name .. ']]' ) |