File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st)
44
44
-> B. ByteString
45
45
-> ParsecT Sources st m (Future st Meta )
46
46
yamlBsToMeta pMetaValue bstr = do
47
+ pos <- getPosition
47
48
case decodeAllWithWarnings bstr of
48
49
Right (warnings, xs) -> do
49
- pos <- getPosition
50
50
mapM_ (\ (Yaml. DuplicateKey jpath) ->
51
51
report (YamlWarning pos $ " Duplicate key: " <>
52
52
T. pack (formatRelativePath jpath)))
@@ -57,7 +57,9 @@ yamlBsToMeta pMetaValue bstr = do
57
57
[] -> return . return $ mempty
58
58
_ -> Prelude. fail " expected YAML object"
59
59
Left err' -> do
60
- let msg = T. pack $ Yaml. prettyPrintParseException err'
60
+ let msg = T. pack $ " Error parsing YAML metadata at " <>
61
+ show pos <> " :\n " <>
62
+ Yaml. prettyPrintParseException err'
61
63
throwError $ PandocParseError $
62
64
if " did not find expected key" `T.isInfixOf` msg
63
65
then msg <>
You can’t perform that action at this time.
0 commit comments