Content deleted Content added
experiment with automatic-striping for nested navboxes providing they do not use "|evenodd = swap"; not successful for "Container test" where original module starts each subgroup as odd |
add kludge to restart odd/even striping to odd for the first list in a subgroup navbox that has a title (the title produces a colored row) |
||
Line 13:
local listnums = {}
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127'
local RESTART_MARKER = '\127_ODDEVEN0_\127'
local REGEX_MARKER = '\127_ODDEVEN(%d?)_\127'
local function striped(wikitext)
Line 34 ⟶ 36:
else
local index = 0
changer = function (
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
return (wikitext:gsub(
end
Line 251 ⟶ 261:
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find('<th[^>]*"navbox%-title"') and RESTART_MARKER or 'odd'
end
listCell
|