Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
markers
Tag: Reverted
neither of these fixed it
Line 5:
local args
local format = string.format
 
local regex_marker = '\127_ODDEVEN(%d?)_\127'
local restart_marker = '\127_ODDEVEN0_\127'
local oddeven_marker = '\127_ODDEVEN_\127'
 
local function striped(wikitext, border)
Line 15 ⟶ 11:
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = '[[Category:Navbox orphans]]'
if border == cfg.keyword.border_subgroup and
args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCatcfg.category.orphan
end
local first, second = 'odd', 'even'
Line 48 ⟶ 43:
end
end
local regex = orphanCatcfg.category.orphan:gsub('([%[%]])', '%%%1')
-- () omits gsub count
return (wikitext:gsub(regex, ''):gsub(regex_markercfg.marker.regex, changer))
end
 
Line 250 ⟶ 245:
local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
local listText = args[list_and_num]
local oddEven = oddeven_markercfg.marker.oddeven
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no auto striping
oddEven = listText:find(cfg.pattern.navbox_title)
and restart_markercfg.marker.restart or 'odd'
end
listCell