Module:Consecutive links

From Caves of Qud Wiki
Revision as of 19:02, 31 August 2019 by Teamtoto (talk | contribs)
Jump to navigation Jump to search

local p = {}

function p.parse(frame)
local separator = frame.args[2]
local replacer = frame.args[3]
local prefix = frame.args[4]
local postfix = frame.args[5]
local linkprefix = frame.args[6]
local linkpostfix = frame.args[7]

local b = string.gsub(frame.args[1], "%s*" .. separator .. "%s*", linkpostfix .. "]]" .. replacer .. "[[" .. linkprefix)
return prefix .. "[[" .. linkprefix .. b .. linkpostfix .."]]" .. postfix
end
return p