@@ -28,6 +28,7 @@ import qualified Data.Set as Set
2828import Data.Text (Text)
2929import qualified Data.Text as T
3030import qualified Data.YAML as YAML
31+import qualified Data.YAML.Event as YE
3132import System.FilePath (addExtension, takeExtension)
3233import Text.HTML.TagSoup
3334import Text.Pandoc.Builder (Blocks, Inlines)
@@ -244,22 +245,22 @@ yamlBsToMeta :: PandocMonad m => BS.ByteString -> MarkdownParser m (F Meta)
244245yamlBsToMeta bstr = do
245246 pos <- getPosition
246247 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
247− Right ((YAML.Doc (YAML.Mapping _ o)):_) -> (fmap Meta) <$> yamlMap o
248+ Right ((YAML.Doc (YAML.Mapping _ _ o)):_) -> (fmap Meta) <$> yamlMap o
248249 Right [] -> return . return $ mempty
249− Right [YAML.Doc (YAML.Scalar YAML.SNull)] -> return . return $ mempty
250+ Right [YAML.Doc (YAML.Scalar _ YAML.SNull)] -> return . return $ mempty
250251 Right _ -> do
251252 logMessage $
252253 CouldNotParseYamlMetadata "not an object"
253254 pos
254255 return . return $ mempty
255− Left err' -> do
256+ Left (_pos, err') -> do
256257 logMessage $ CouldNotParseYamlMetadata
257258 err' pos
258259 return . return $ mempty
259260
260−nodeToKey :: Monad m => YAML.Node -> m Text
261−nodeToKey (YAML.Scalar (YAML.SStr t)) = return t
262−nodeToKey (YAML.Scalar (YAML.SUnknown _ t)) = return t
261+nodeToKey :: Monad m => YAML.Node YE.Pos -> m Text
262+nodeToKey (YAML.Scalar _ (YAML.SStr t)) = return t
263+nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = return t
263264nodeToKey _ = fail "Non-string key in YAML mapping"
264265
265266toMetaValue :: PandocMonad m
@@ -291,8 +292,8 @@ checkBoolean t =
291292 else Nothing
292293
293294yamlToMetaValue :: PandocMonad m
294− => YAML.Node -> MarkdownParser m (F MetaValue)
295−yamlToMetaValue (YAML.Scalar x) =
295+ => YAML.Node YE.Pos-> MarkdownParser m (F MetaValue)
296+yamlToMetaValue (YAML.Scalar _ x) =
296297 case x of
297298 YAML.SStr t -> toMetaValue t
298299 YAML.SBool b -> return $ return $ MetaBool b
@@ -303,16 +304,16 @@ yamlToMetaValue (YAML.Scalar x) =
303304 Just b -> return $ return $ MetaBool b
304305 Nothing -> toMetaValue t
305306 YAML.SNull -> return $ return $ MetaString ""
306−yamlToMetaValue (YAML.Sequence _ xs) = do
307+yamlToMetaValue (YAML.Sequence _ _ xs) = do
307308 xs' <- mapM yamlToMetaValue xs
308309 return $ do
309310 xs'' <- sequence xs'
310311 return $ B.toMetaValue xs''
311−yamlToMetaValue (YAML.Mapping _ o) = fmap B.toMetaValue <$> yamlMap o
312+yamlToMetaValue (YAML.Mapping _ _ o) = fmap B.toMetaValue <$> yamlMap o
312313yamlToMetaValue _ = return $ return $ MetaString ""
313314
314315yamlMap :: PandocMonad m
315− => M.Map YAML.Node YAML.Node
316+ => M.Map (YAML.Node YE.Pos) (YAML.Node YE.Pos)
316317 -> MarkdownParser m (F (M.Map String MetaValue))
317318yamlMap o = do
318319 kvs <- forM (M.toList o) $ \(key, v) -> do