9,856
editsno edit summary
No edit summary Tag: Manual revert |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
function p.main(frame) | function p.main(frame) | ||
local args = getArgs(frame, { | -- Important to use removeBlanks = false here, because otherwise a blank | ||
wrappers = 'Template:IfEmpty' | -- positional arg will be turned into nil, and Lua's ipairs() stops when a | ||
-- value is nil, so you won't be able to iterate over the rest of the | |||
-- positional args. | |||
local args = getArgs(frame, { | |||
wrappers = 'Template:IfEmpty', | |||
removeBlanks = false, | |||
}) | }) | ||
for i, v in ipairs(args) do | |||
for | |||
if v ~= '' then | if v ~= '' then | ||
return v | return v |