Module:Sandbox/Jackmcbarn: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
figure out why this is so slow
Jackmcbarn (talk | contribs)
reduce test case
Line 2:
 
function p.main(frame)
local givenargs = frame.args[1]{}
for k,v in pairs(frame.args) do
if given == nil or given == '' then
args[k] = v
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