Module:FormatGuests
From Very Bad Wiki
More actions
Documentation for this module may be created at Module:FormatGuests/doc
local p = {}
function p.formatList(frame)
local input = frame.args[1] or ""
local sep = frame.args.sep or ","
local result = {}
for item in string.gmatch(input, "([^" .. sep .. "]+)") do
item = item:match("^%s*(.-)%s*$") -- trim whitespace
if item ~= "" then
table.insert(result, "[[" .. item .. "]]")
end
end
return table.concat(result, ", ")
end
return p