Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
No edit summary
Jackmcbarn (talk | contribs)
tweak nowrapping code
Line 30:
table.insert(listLines, (line:gsub('^([*:;]+[ \t]*)(.-)$', function(lineStart, lineContent)
if lineContent:match('^<span class="nowrap">') then
-- avoid the nowrap getting applied twice
return lineStart .. lineContent
else
Line 346 ⟶ 347:
args = navboxArgs
 
nowraplists = trim(args.nowraplists or '') ~= ''
for k, v in pairs(args) do
local listnum = ('' string.. k):match(k, '^list(%d+)$')
if listnum then table.insert(listnums, tonumber(listnum)) end
-- preprocess lists in listX, above, and below if nowraplists has been set
if args.nowraplists and (listnum or string.match(k, '^above') or string.match(k, '^below')) then
args[k] = nowrapList(v)
if type(k) == 'string' and (k:match('^list[0-9]') or k:match('^above') or k:match('^below')) then
args[k] = nowrapList(v)
end
end
end