@@ -31,10 +31,10 @@ import Text.Pandoc.Error
31import Text.Pandoc.Parsing hiding (tableWith)
31import Text.Pandoc.Parsing hiding (tableWith)
32import Text.Pandoc.Shared
32import Text.Pandoc.Shared
34−yamlBsToMeta :: PandocMonad m
34+yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st)
35− => ParserT Text ParserState m (F MetaValue)
35+ => ParserT Text st m (Future st MetaValue)
36 -> BL.ByteString
36 -> BL.ByteString
37− -> ParserT Text ParserState m (F Meta)
37+ -> ParserT Text st m (Future st Meta)
38yamlBsToMeta pMetaValue bstr = do
38yamlBsToMeta pMetaValue bstr = do
39 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
39 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
40 Right (YAML.Doc (YAML.Mapping _ _ o):_)
40 Right (YAML.Doc (YAML.Mapping _ _ o):_)
@@ -63,11 +63,11 @@ lookupYAML t (YAML.Mapping _ _ m) =
63lookupYAML _ _ = Nothing
63lookupYAML _ _ = Nothing
65-- Returns filtered list of references.
65-- Returns filtered list of references.
66−yamlBsToRefs :: PandocMonad m
66+yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st)
67− => ParserT Text ParserState m (F MetaValue)
67+ => ParserT Text st m (Future st MetaValue)
68 -> (Text -> Bool) -- ^ Filter for id
68 -> (Text -> Bool) -- ^ Filter for id
69 -> BL.ByteString
69 -> BL.ByteString
70− -> ParserT Text ParserState m (F [MetaValue])
70+ -> ParserT Text st m (Future st [MetaValue])
71yamlBsToRefs pMetaValue idpred bstr =
71yamlBsToRefs pMetaValue idpred bstr =
72 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
72 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
73 Right (YAML.Doc o@YAML.Mapping{}:_)
73 Right (YAML.Doc o@YAML.Mapping{}:_)
@@ -104,10 +104,10 @@ nodeToKey (YAML.Scalar _ (YAML.SStr t)) = Just t
104nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = Just t
104nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = Just t
105nodeToKey _ = Nothing
105nodeToKey _ = Nothing
107−normalizeMetaValue :: PandocMonad m
107+normalizeMetaValue :: (PandocMonad m, HasLastStrPosition st)
108− => ParserT Text ParserState m (F MetaValue)
108+ => ParserT Text st m (Future st MetaValue)
110− -> ParserT Text ParserState m (F MetaValue)
110+ -> ParserT Text st m (Future st MetaValue)
111normalizeMetaValue pMetaValue x =
111normalizeMetaValue pMetaValue x =
112 -- Note: a standard quoted or unquoted YAML value will
112 -- Note: a standard quoted or unquoted YAML value will
113 -- not end in a newline, but a "block" set off with
113 -- not end in a newline, but a "block" set off with
@@ -129,10 +129,10 @@ checkBoolean t
129 | t == T.pack "false" || t == T.pack "False" || t == T.pack "FALSE" = Just False
129 | t == T.pack "false" || t == T.pack "False" || t == T.pack "FALSE" = Just False
130 | otherwise = Nothing
130 | otherwise = Nothing
132−yamlToMetaValue :: PandocMonad m
132+yamlToMetaValue :: (PandocMonad m, HasLastStrPosition st)
133− => ParserT Text ParserState m (F MetaValue)
133+ => ParserT Text st m (Future st MetaValue)
134 -> YAML.Node YE.Pos
134 -> YAML.Node YE.Pos
135− -> ParserT Text ParserState m (F MetaValue)
135+ -> ParserT Text st m (Future st MetaValue)
136yamlToMetaValue pMetaValue (YAML.Scalar _ x) =
136yamlToMetaValue pMetaValue (YAML.Scalar _ x) =
137 case x of
137 case x of
138 YAML.SStr t -> normalizeMetaValue pMetaValue t
138 YAML.SStr t -> normalizeMetaValue pMetaValue t
@@ -152,10 +152,10 @@ yamlToMetaValue pMetaValue (YAML.Mapping _ _ o) =
152 fmap MetaMap <$> yamlMap pMetaValue o
152 fmap MetaMap <$> yamlMap pMetaValue o
153yamlToMetaValue _ _ = return $ return $ MetaString ""
153yamlToMetaValue _ _ = return $ return $ MetaString ""
155−yamlMap :: PandocMonad m
155+yamlMap :: (PandocMonad m, HasLastStrPosition st)
156− => ParserT Text ParserState m (F MetaValue)
156+ => ParserT Text st m (Future st MetaValue)
157 -> M.Map (YAML.Node YE.Pos) (YAML.Node YE.Pos)
157 -> M.Map (YAML.Node YE.Pos) (YAML.Node YE.Pos)
158− -> ParserT Text ParserState m (F (M.Map Text MetaValue))
158+ -> ParserT Text st m (Future st (M.Map Text MetaValue))
159yamlMap pMetaValue o = do
159yamlMap pMetaValue o = do
160 kvs <- forM (M.toList o) $ \(key, v) -> do
160 kvs <- forM (M.toList o) $ \(key, v) -> do
161 k <- maybe (throwError $ PandocParseError
161 k <- maybe (throwError $ PandocParseError