From 3f595659a3ed28f8dfdb6a378cc9d4e97b9a3a54 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 10:22:10 -0800 Subject: 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 --- src/Text/Pandoc/Readers/Metadata.hs | 4 ++-- 1 file 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) = -- cgit v1.2.3