Module:MultiReplace and Module:MultiReplace/sandbox: Difference between pages
(Difference between pages)
imported>Pppery Per edit request |
imported>Ahecht add unstrip option |
||
Line 1: | Line 1: | ||
p = {} | |||
local function MultiReplace(args) | local function MultiReplace(args) | ||
local input = args[1] or "{{{1}}}" | local input = args[1] or "{{{1}}}" | ||
if args.unstrip == "yes" then input = mw.text.unstrip(input) end | |||
local plain = args.plain == "yes" | local plain = args.plain == "yes" | ||
Line 11: | Line 13: | ||
if not change.repl then | if not change.repl then | ||
return require('Module:Error').error{ | return require('Module:Error').error{ | ||
'MultiReplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. | 'MultiReplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. change.pattern .. '</code>' | ||
} | } | ||
end | end |