Module:Pipes

From Fallen London Wiki

Documentation for this module may be created at Module:Pipes/doc

local p = {}

function p.call_unescaped(frame)
	-- TODO: Check number of arguments.
	template = frame.args[1]
	args = {}
	for i, arg in ipairs(frame.args) do 
		if i > 1 then 
			for s in string.gmatch(arg, "([^\|]+)") do 
				-- TODO: Remove whitespace symbols at the start/end of `s`.
				-- TODO: Or not? Lua might fail differentiating " " and "<nowiki> </nowiki>" there.
				table.insert(args, s)
			end
		end
	end 
	return frame:expandTemplate{
		title = template,
		args = args
	}
end

return p