Module:List

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

local p = {}

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

function p._main(args) local items = fp.map(mw.text.trim, args) 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