Module:Sandbox/Jackmcbarn

This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 19:58, 27 May 2014 (figure out why this is so slow). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

function p.main(frame)
    local given = frame.args[1]
    if given == nil or given == '' then
        return ""
    end
    local args = {}
    given = given .. "!"
    for item in given:gmatch( "(.-)!") do
        local p = item:find('=', 1, true)
        if p then
            args[item:sub(1, p-1)] = item:sub(p+1)
        else
            table.insert(args, item)
        end
    end
    return frame:expandTemplate{ title = "convert/old", args = args }
end

return p