Content deleted Content added
MusikAnimal (talk | contribs) m Changed protection level for "Module:MultiReplace": High-risk Lua module: allow extended confirmed editors to edit ([Edit=Require extended confirmed access] (indefinite)) |
Per edit request |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 1:
local p = {}
local function
local args = frame:getParent().args▼
local input = args[1] or "{{{1}}}"
local plain = args.plain == "yes"
Line 11 ⟶ 10:
local change = {pattern = args[i * 2], repl = args[i * 2 + 1]}
if not change.repl then
return
▲ args = { 'Multireplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. change.pattern .. '</code>' }
}
end
Line 45 ⟶ 43:
end
return result
end
function p.main(frame, ...)
local args =
type(frame) ~= 'table' and {frame, ...} or
type(frame.args) ~= 'table' and frame or
frame.args[1] and frame.args or
return MultiReplace(args)
end
|