Module:List

local table = require('Module:Std/table') local fp = require('Module:Std/functional') local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.main(frame) -- transforms args from metatable to a regular table (necessary to use table functions) local args = table.merge({}, getArgs(frame)) return p._main(args) end

function p._main(args) local items = fp.map(mw.text.trim, args) if table.size(items) == 0 then return args.default end if args.delim == 'prosaic' then return mw.text.listToText(items) else local delim = (args.delim and args.delim:match("^'(.*)'$") or args.delim) or ' ' return table.concat(items, mw.text.decode(delim)) end end

return p