Module:MultiReplace: Difference between revisions

Content deleted Content added
rm Superfluous input sanitization
Per edit request
 
(3 intermediate revisions by 2 users not shown)
Line 1:
local p = {}
 
local function MultiReplace(args)
Line 11:
if not change.repl then
return require('Module:Error').error{
'MultiReplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. mw.text.nowiki(change.pattern) .. '</code>'
}
end
Line 45:
end
 
function p.main(frame, ...)
local args =
if type(frame.args) =~= 'table' thenand {frame, ...} or
if type(frame.args[1]) ~= 'table' and frame thenor
frame.args[1] =and frame.args or
args = frame:getParent().args
else
args = frame:getParent().args
end
else
args = frame
end
return MultiReplace(args)
end