Module:Ustring: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
en>Johnuniq m Changed protection level for "Module:Ustring": High-risk Lua module: per request at WP:RFPP; used by TE protected Template:R from Unicode character ([Edit=Require template editor access] (indefinite)) |
Quantumhusky (talk | contribs) m 1 revision imported |
(No difference)
|
Latest revision as of 01:03, 7 June 2021
Documentation for this module may be created at Module:Ustring/doc
require('Module:No globals')
return setmetatable({}, {
__index = function(t, k)
local what = mw.ustring[k]
if type(what) ~= "function" then
return what
end
return function(frame)
local args = frame.args
for _, v in ipairs(args) do
args[_] = tonumber(v) or v:gsub("^\\", "", 1)
end
if not args.tag then
return (what(unpack(args)))
end
local tagargs = {}
for x, y in pairs(args) do
if type(x) ~= 'number' and x ~= 'tag' then tagargs[x] = y end
end
return frame:extensionTag{name = args.tag, content = what(unpack(args)), args = tagargs}
end
end
})