aboutsummaryrefslogtreecommitdiff
path: root/data/pandoc.lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2018-10-15 21:00:50 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2018-10-15 21:00:50 +0200
commita444321be87da3cba36c737995cd1590fa644e8b (patch)
treed091b7f5e171bc552dd620a6b0c6f30707090760 /data/pandoc.lua
parentd04ded4ca999e9488128e1b85e1566fca3ef3a48 (diff)
downloadpandoc-a444321be87da3cba36c737995cd1590fa644e8b.tar.gz
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.
Diffstat (limited to 'data/pandoc.lua')
-rw-r--r--data/pandoc.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 1e2d2a061..dc09c85f8 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -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