@@ -50,8 +50,7 @@ import Data.Sequence (viewr, ViewR(..))
5050import Data.Char (toLower, isHexDigit, isSpace)
5151import Data.Monoid ((<>))
5252import Control.Monad.Except (throwError, catchError)
53−import Text.Pandoc.Class (PandocMonad, warning, readFileLazy)
54−import qualified Text.Pandoc.Class as P
53+import Text.Pandoc.Class (PandocMonad, warning, readFileLazy, warningWithPos)
5554
5655-- | Parse reStructuredText string and return Pandoc document.
5756readRST :: PandocMonad m
@@ -695,7 +694,7 @@ directive' = do
695694 return $ B.divWith attrs children
696695 other -> do
697696 pos <- getPosition
698− P.warningWithPos pos $ "ignoring unknown directive: " ++ other
697+ warningWithPos pos $ "ignoring unknown directive: " ++ other
699698 return mempty
700699
701700-- TODO:
@@ -723,20 +722,20 @@ addNewRole roleString fields = do
723722
724723 -- warn about syntax we ignore
725724 flip mapM_ fields $ \(key, _) -> case key of
726− "language" -> when (baseRole /= "code") $ P.warning $
725+ "language" -> when (baseRole /= "code") $ warning $
727726 "ignoring :language: field because the parent of role :" ++
728727 role ++ ": is :" ++ baseRole ++ ": not :code:"
729− "format" -> when (baseRole /= "raw") $ P.warning $
728+ "format" -> when (baseRole /= "raw") $ warning $
730729 "ignoring :format: field because the parent of role :" ++
731730 role ++ ": is :" ++ baseRole ++ ": not :raw:"
732− _ -> P.warning $ "ignoring unknown field :" ++ key ++
731+ _ -> warning $ "ignoring unknown field :" ++ key ++
733732 ": in definition of role :" ++ role ++ ": in"
734733 when (parentRole == "raw" && countKeys "format" > 1) $
735− P.warning $
734+ warning $
736735 "ignoring :format: fields after the first in the definition of role :"
737736 ++ role ++": in"
738737 when (parentRole == "code" && countKeys "language" > 1) $
739− P.warning $
738+ warning $
740739 "ignoring :language: fields after the first in the definition of role :"
741740 ++ role ++": in"
742741
@@ -1134,7 +1133,7 @@ renderRole contents fmt role attr = case role of
11341133 renderRole contents newFmt newRole newAttr
11351134 Nothing -> do
11361135 pos <- getPosition
1137− P.warningWithPos pos $ "ignoring unknown role :" ++ custom ++ ": in"
1136+ warningWithPos pos $ "ignoring unknown role :" ++ custom ++ ": in"
11381137 return $ B.str contents -- Undefined role
11391138 where
11401139 titleRef ref = return $ B.str ref -- FIXME: Not a sensible behaviour
@@ -1219,7 +1218,7 @@ explicitLink = try $ do
12191218 case M.lookup key keyTable of
12201219 Nothing -> do
12211220 pos <- getPosition
1222− addWarning (Just pos) $
1221+ warningWithPos pos $
12231222 "Could not find reference for " ++
12241223 show key
12251224 return ("","",nullAttr)
@@ -1244,7 +1243,7 @@ referenceLink = try $ do
12441243 ((src,tit), attr) <- case M.lookup key keyTable of
12451244 Nothing -> do
12461245 pos <- getPosition
1247− addWarning (Just pos) $
1246+ warningWithPos pos $
12481247 "Could not find reference for " ++
12491248 show key
12501249 return (("",""),nullAttr)
@@ -1275,7 +1274,7 @@ subst = try $ do
12751274 case M.lookup key substTable of
12761275 Nothing -> do
12771276 pos <- getPosition
1278− addWarning (Just pos) $
1277+ warningWithPos pos $
12791278 "Could not find reference for " ++ show key
12801279 return mempty
12811280 Just target -> return target
@@ -1290,7 +1289,7 @@ note = try $ do
12901289 case lookup ref notes of
12911290 Nothing -> do
12921291 pos <- getPosition
1293− addWarning (Just pos) $
1292+ warningWithPos pos $
12941293 "Could not find note for " ++ show ref
12951294 return mempty
12961295 Just raw -> do