Module:Ustring: Difference between revisions

Content deleted Content added
Can you not reinvent the wheel?
minor optimizations by avoiding extraneous multi-table references and returning most common cases first
Line 11:
args[_] = tonumber(v) or v:gsub("^\\", "", 1)
end
if not args.tag then
localreturn tag = {name = args.tag, content = mw.ustring[k](what(unpack(args)), args = {}})
for x, y in pairs(args) do
if type(x) ~= 'number' and x ~= 'tag' then tag.args[x] = y end
end
return frame:extensionTag(tag)
end
local tagargs = {}
return (mw.ustring[k](unpack(args)))
for x, y in pairs(args) do
if type(x) ~= 'number' and x ~= 'tag' then tag.argstagargs[x] = y end
end
return frame:extensionTag{name = args.tag, content = what(unpack(args)), args = tagargs}
end
end