Content deleted Content added
sync |
improve ease of access from other Lua modules, expand the comments a little |
||
Line 381:
function p.navbox(frame)
-- If called via #invoke, use the args passed into the invoking template. Otherwise,
-- ParserFunctions considers the empty string to be false, so to preserve the previous ▼
-- assume args are being passed directly in from the debug console or from another Lua module.
-- behavior of {{navbox}}, change any empty arguments to nil, so Lua will consider▼
-- them false too.▼
if frame == mw.getCurrentFrame() then
▲ local args = {}
else▼
origArgs = frame;
end
--
-- that they were processed in the old {{navbox}} template. If they are processed in a different
-- order, we see errors such as {{reflist}} templates being processed before the references that
-- are supposed to appear in them.
local temp;
temp =
temp =
for i = 1, 20 do
temp =
temp =
end
temp =
▲ -- ParserFunctions considers the empty string to be false, so to preserve the previous
for k, v in pairs(parent_args) do▼
▲ -- behavior of {{navbox}}, change any empty arguments to nil, so Lua will consider
if v ~= '' then▼
▲ -- them false too.
local args = {}
args[k] = v
end
|