Content deleted Content added
escape with only ^\ is sufficient |
m Changed protection settings for "Module:Ustring": Used by fully protected Template:Str rightc -> Template:New page DYM -> Template:No article text (-> WP:CASC) ([Edit=Require administrator access] (indefinite)) |
||
(20 intermediate revisions by 7 users not shown) | |||
Line 1:
require('strict')
return setmetatable({}, {
for k, v in pairs(mw.ustring) do▼
local what = mw.ustring[k]
▲ p[k] = function(frame)
if type(what) ~= "function" then
local args = {}▼
for _, v in ipairs(frame.args) do▼
table.insert(args, tonumber(v) or v:gsub("^\\", "", 1))▼
end
local
local fargsused = { tag = true }
▲ local args = {}
local str_i = 1
while fargs['s' .. str_i] do
fargsused['s' .. str_i] = true
args[str_i] = fargs['s' .. str_i]
str_i = str_i + 1
end
fargsused[i] = true
end▼
if not fargs.tag then
return (what(unpack(args))) -- Outside parens truncate to first result avoiding tail call
end
local tagargs = {}
if not fargsused[x] then tagargs[x] = y end
end
return frame:extensionTag{name = fargs.tag, content = what(unpack(args)), args = tagargs}
end
end
})
▲end
▲return p
|