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
This commit is contained in:
John MacFarlane 2021-11-21 10:22:10 -08:00
parent eeafc3a2ea
commit 3f595659a3

View file

@ -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) =