Skip to content

Commit 3f59565

Browse files
committed
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
1 parent eeafc3a commit 3f59565

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Text/Pandoc/Readers/Metadata.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st)
5656
-> B.ByteString
5757
-> ParserT Sources st m (Future st [MetaValue])
5858
yamlBsToRefs pMetaValue idpred bstr =
59-
case Yaml.decodeEither' bstr of
60-
Right (Object m) -> do
59+
case Yaml.decodeAllEither' bstr of
60+
Right (Object m : _) -> do
6161
let isSelected (String t) = idpred t
6262
isSelected _ = False
6363
let hasSelectedId (Object o) =

0 commit comments

Comments
 (0)