Module:Navbox: Difference between revisions

Jump to navigation Jump to search
309 bytes added ,  7 March 2013
fix for empty params
(undo test)
(fix for empty params)
Line 351: Line 351:
      
      
     for k, v in pairs(args) do
     for k, v in pairs(args) do
         local listnum = ('' .. k):match('^list(%d+)$')
         if v == '' then
        if listnum then table.insert(listnums, tonumber(listnum)) end
            -- 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+)$')
            if listnum then table.insert(listnums, tonumber(listnum)) end
        end
     end
     end
     table.sort(listnums)
     table.sort(listnums)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu