-- This module takes positional parameters as input and concatenates them with-- an optional separator. The final separator (the "conjunction") can be-- specified independently, enabling natural-language lists like-- "foo, bar, baz and qux". The starting parameter can also be specified.localcompressSparseArray=require('Module:TableTools').compressSparseArraylocalp={}functionp._main(args)localdataPlural=args.dataPlurallocalseparator=args.separator-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.andmw.text.decode(args.separator)or''localconjunction=args.conjunctionandmw.text.decode(args.conjunction)orseparator-- Discard values before the starting parameter.localstart=tonumber(args.start)ifstartthenfori=1,start-1doargs[i]=nilendend-- Discard named parameters.localvalues=compressSparseArray(args)localresult=mw.text.listToText(values,separator,conjunction)ifdataPluraland#values>0and(#separator>0or#conjunction>0)then-- flag to [[Module:Detect singular]] whether this is a list with >1 elementresult=result..'<span style="display:none" data-plural="'..(#values>1and'1'or'0')..'"></span>'endreturnresultendlocalfunctionmakeInvokeFunction(separator,conjunction,first)returnfunction(frame)localargs=require('Module:Arguments').getArgs(frame,{frameOnly=(frame.args.frameOnlyor'')~=''})args.separator=separatororargs.separatorargs.conjunction=conjunctionorargs.conjunctionargs.first=firstorargs.firstreturnp._main(args)endendp.main=makeInvokeFunction()p.br=makeInvokeFunction('<br />')p.comma=makeInvokeFunction(mw.message.new('comma-separator'):plain())returnp