Lua pandoc module: fix MetaList constructor

Passing a MetaList object to the constructor `pandoc.MetaList` now
returns the passed list as a MetaList. This is consistent with the
constructor behavior when passed an (untagged) list.

Previously, the constructor used to create a new MetaList with the
passed MetaList as its only element.
This commit is contained in:
Albert Krewinkel 2018-10-15 21:00:50 +02:00
parent d04ded4ca9
commit a444321be8

View file

@ -267,7 +267,12 @@ M.MetaInlines = M.MetaValue:create_constructor(
-- @tparam {MetaValue,...} meta_values list of meta values
M.MetaList = M.MetaValue:create_constructor(
'MetaList',
function (content) return ensureList(content) end
function (content)
if content.tag == 'MetaList' then
return content
end
return ensureList(content)
end
)
--- Meta map