8,290
edits
(ignores white space and can specify what the replacer char can be) |
m (add support for prefix and postfix) |
||
Line 4: | Line 4: | ||
local separator = frame.args[2] | local separator = frame.args[2] | ||
local replacer = frame.args[3] | local replacer = frame.args[3] | ||
local prefix = frame.args[4] | |||
local postfix = frame.args[5] | |||
local b = string.gsub(frame.args[1], "%s*" .. separator .. "%s*", "]]" .. replacer .. "[[") | local b = string.gsub(frame.args[1], "%s*" .. separator .. "%s*", "]]" .. replacer .. "[[") | ||
return "[[".. b .. "]]" | return prefix .. "[[" .. b .. "]]" .. postfix | ||
end | end | ||
return p | return p |