Module:Consecutive links: Difference between revisions
Jump to navigation
Jump to search
m (i can't spell) |
(ignores white space and can specify what the replacer char can be) |
||
Line 3: | Line 3: | ||
function p.parse(frame) | function p.parse(frame) | ||
local separator = frame.args[2] | local separator = frame.args[2] | ||
local b = string.gsub(frame.args[1], separator, "]]" .. | local replacer = frame.args[3] | ||
local b = string.gsub(frame.args[1], "%s*" .. separator .. "%s*", "]]" .. replacer .. "[[") | |||
return "[[".. b .. "]]" | return "[[".. b .. "]]" | ||
end | end | ||
return p | return p |