Module:Navbox: Difference between revisions
From Test Wiki
Content deleted Content added
undo test |
fix for empty params |
||
| Line 351: | Line 351: | ||
for k, v in pairs(args) do |
for k, v in pairs(args) do |
||
if v == '' then |
|||
-- ParserFunctions considers the empty string to be false, so to preserve the previous |
|||
| ⚫ | |||
-- behavior of {{navbox}}, change any empty arguments to nil, so Lua will consider |
|||
-- them false too. |
|||
args[k] = nil |
|||
else |
|||
local listnum = ('' .. k):match('^list(%d+)$') |
|||
| ⚫ | |||
end |
|||
end |
end |
||
table.sort(listnums) |
table.sort(listnums) |
||