Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
m local
Don't calculate arghash in p.navbox
Line 854:
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
local _ = 0
_ = _ + (args[prefix .. cfg.arg.title]
_ and= #args[prefix .. cfg.arg.titleabove] or 0)
_ = _ + (args[prefix .. cfg.arg.above] and #args[prefix .. cfg.arg.above] or 0)
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
for i = 1, 20 do
_ = _ + (args[prefix .. andnum('group', i)] and #args[prefix .. andnum('group', i)] or 0)
localif list =inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then
_ = _ + (list and #list or 0)
if inArray(cfg.keyword.subgroups, list) then
for _, v in ipairs(cfg.arg.subgroups_and_num) do
readArgs(args, prefix .. string.format(v, i) .. "_")
Line 870 ⟶ 868:
end
end
_ = _ + (args[prefix .. cfg.arg.below] and #args[prefix .. cfg.arg.below] or 0)
return _
end
 
Line 878 ⟶ 875:
end
local args = getArgs(frame, {wrappers = {cfg.pattern[boxtype or 'navbox']}})
args.argHash = readArgs(args, "")
args.argHash = nil -- we shouldn't accept argHash passed from a template
args.type = args.type or cfg.keyword[boxtype]
return p['_navbox'](args)