FANDOM


-- <nowiki>
local p = {}
 
local yesno = require('Dev:Yesno')
 
function p.main(frame)
    local args = frame:getParent().args
    local contents = {
        '<infobox theme="',
        args.theme or 'navbox',
        '"><group'
    }
    if yesno(args.collapse or true, true) then
        table.insert(contents, ' collapse="closed"')
    end
    table.insert(contents, '>')
    if args[1] then
        table.insert(contents, '<header>')
        table.insert(contents, args[1])
        table.insert(contents, '</header>')
    end
    for k, v in ipairs(args) do
        local i = tonumber(k)
        if i and v and i > 1 then
            i = i - 2
            if i % 2 == 0 then
                table.insert(contents, '<data><label>')
                table.insert(contents, v)
                table.insert(contents, '</label>')
            else
                local r, _ = mw.ustring.gsub(v, table.concat({' ', args.separator or '!', ' '}), '&#32;•&#32;')
                table.insert(contents, '<default>')
                table.insert(contents, r)
                table.insert(contents, '</default></data>')
            end
        end
    end
    table.insert(contents, '</group></infobox>')
    return frame:preprocess(table.concat(contents))
end
 
return p
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+