Module:CargoQuery: Difference between revisions

78 bytes added ,  11:57, 2 September 2020
change meta separator thru arguments
mNo edit summary
(change meta separator thru arguments)
Line 155: Line 155:


local args = h.merge(false)
local args = h.merge(false)
local splitargs = {}
 
for a, b in ipairs(args) do
    splitargs[a] = util_args.splitNamedArgs(frame:preprocess(b), '%s*;%s*')
end
template = frame:preprocess(args['template'] or '')
template = frame:preprocess(args['template'] or '')
delimiter = frame:preprocess(args['delimiter'] or '')
if template == nil or template == '' then
if template == nil or template == '' then
     error('A template must be specified!')
     error('A template must be specified!')
end
end
delimiter = frame:preprocess(args['delimiter'] or '')
metasep = frame:preprocess(args['metaseparator'] or ';')
local splitargs = {}
for a, b in ipairs(args) do
    splitargs[a] = util_args.splitNamedArgs(frame:preprocess(b), '%s*' .. metasep .. '%s*')
end
splitargs['default'] = ''
splitargs['default'] = ''