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) return p._main(getArgs(frame)) 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) elseif args.delim == "bulleted" then return p.unorderedList(items) else local delim = (args.delim and args.delim:match("^'(.*)'$") or args.delim) or ' ' return table.concat(items, mw.text.decode(delim)) end end

function p.unorderedList(items) local list = "" for _, v in pairs(items) do list = list .. "" .. v .. "" end list = list .. "" return list end

return p