diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-11-24 16:41:52 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-11-24 16:54:12 +0100 |
commit | a8638894ab698cc0e49757a2732e383b652834bc (patch) | |
tree | f002d8cdf3f40b5a7a450a0aa2cd0f16a06d491f /src/Text/Pandoc/Lua/Marshaling | |
parent | 79e6f8db13ef8f0db6da8fe4e17b7626fe6ef3e9 (diff) | |
download | pandoc-a8638894ab698cc0e49757a2732e383b652834bc.tar.gz |
Lua: allow single elements as singleton MetaBlocks/MetaInlines
Single elements should always be treated as singleton lists in the Lua
subsystem.
Diffstat (limited to 'src/Text/Pandoc/Lua/Marshaling')
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/AST.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 9cf683055..6a0e5d077 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -247,6 +247,9 @@ peekMetaValue = retrieving "MetaValue $ " . \idx -> do optional (LuaUtil.getTag idx) >>= \case Just tag -> peekTagged tag Nothing -> peekUntagged + Lua.TypeUserdata -> -- Allow singleton Inline or Block elements + (MetaInlines . (:[]) <$!> peekInline idx) <|> + (MetaBlocks . (:[]) <$!> peekBlock idx) _ -> failPeek "could not get meta value" typeBlock :: LuaError e => DocumentedType e Block |