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.
commita444321be87da3cba36c737995cd1590fa644e8b
authorAlbert Krewinkel <albert@zeitkraut.de>
dateMon 15 Oct 2018, 21:00 (8 years ago)
parentd04ded4
data/pandoc.lua+6−1
@@ -267,7 +267,12 @@ M.MetaInlines = M.MetaValue:create_constructor(
267267-- @tparam {MetaValue,...} meta_values list of meta values
268268M.MetaList = M.MetaValue:create_constructor(
269269 'MetaList',
270− function (content) return ensureList(content) end
270+ function (content)
271+ if content.tag == 'MetaList' then
272+ return content
273+ end
274+ return ensureList(content)
275+ end
271276)
272277
273278--- Meta map