aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-11-21 10:22:10 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-11-21 10:22:10 -0800
commit3f595659a3ed28f8dfdb6a378cc9d4e97b9a3a54 (patch)
tree7c3399ea03357aaf8dd19dbd1461b920ccbe5914
parenteeafc3a2eaab3a0cdc2563ab573f00e66fdc0cef (diff)
downloadpandoc-3f595659a3ed28f8dfdb6a378cc9d4e97b9a3a54.tar.gz
yamlBsToRefs: allow multiple YAML documents.
Some people use `---` as the end delimiter in YAML bibliography files, which causes the `yaml` library to emit an error unless we explicitly allow multiple YAML documents (and just consider the first). In T.P.Readers.Metadata
-rw-r--r--src/Text/Pandoc/Readers/Metadata.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
index 30760e933..7991dca5c 100644
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -56,8 +56,8 @@ yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st)
-> B.ByteString
-> ParserT Sources st m (Future st [MetaValue])
yamlBsToRefs pMetaValue idpred bstr =
- case Yaml.decodeEither' bstr of
- Right (Object m) -> do
+ case Yaml.decodeAllEither' bstr of
+ Right (Object m : _) -> do
let isSelected (String t) = idpred t
isSelected _ = False
let hasSelectedId (Object o) =