aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-11-09 12:59:26 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-11-09 12:59:26 -0800
commit5fb3b82bdf2accb785380c78cf8481bbe06b73f1 (patch)
tree57c0e61b00b677f8f2feee6a6138d5977b8c11bd /src/Text
parentd4c73d5e6536535015f953ba2e5c3b83979819af (diff)
downloadpandoc-5fb3b82bdf2accb785380c78cf8481bbe06b73f1.tar.gz
Accept empty `--metadata-file`.
Closes #7675. This is a regression from 2.15 behavior.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Metadata.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
index 534a7645b..30760e933 100644
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -42,6 +42,7 @@ yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st)
yamlBsToMeta pMetaValue bstr = do
case Yaml.decodeAllEither' bstr of
Right (Object o:_) -> fmap Meta <$> yamlMap pMetaValue o
+ Right [] -> return . return $ mempty
Right [Null] -> return . return $ mempty
Right _ -> Prelude.fail "expected YAML object"
Left err' -> do