Module:Consecutive links: Difference between revisions
m add support for prefix and postfix |
m avoid double linking ([[[[<link>]]]]) if links are passed to this module |
||
Line 7: | Line 7: | ||
local postfix = frame.args[5] | 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 .. "[[") | ||
b = "[[" .. b .. "]]" | |||
b = string.gsub(string.gsub(b,"[[[[","[["),"]]]]","]]") | |||
return prefix .. b .. postfix | |||
end | end | ||
return p | return p |