@@ -50,7 +50,6 @@ import Data.Sequence (viewr, ViewR(..))
50import Data.Char (toLower, isHexDigit, isSpace)
50import Data.Char (toLower, isHexDigit, isSpace)
51import Data.Monoid ((<>))
51import Data.Monoid ((<>))
52import Control.Monad.Except (throwError, catchError)
52import Control.Monad.Except (throwError, catchError)
53−import Control.Monad.Trans (lift)
54import Text.Pandoc.Class (PandocMonad, warning, readFileLazy)
53import Text.Pandoc.Class (PandocMonad, warning, readFileLazy)
55import qualified Text.Pandoc.Class as P
54import qualified Text.Pandoc.Class as P
@@ -423,11 +422,11 @@ include = try $ do
423 when (f `elem` containers) $
422 when (f `elem` containers) $
424 throwError $ PandocParseError $ "Include file loop at " ++ show oldPos
423 throwError $ PandocParseError $ "Include file loop at " ++ show oldPos
425 updateState $ \s -> s{ stateContainers = f : stateContainers s }
424 updateState $ \s -> s{ stateContainers = f : stateContainers s }
426− res <- lift $ readFileLazy' f
425+ res <- readFileLazy' f
427 contents <- case res of
426 contents <- case res of
428 Right x -> return x
427 Right x -> return x
429 Left _e -> do
428 Left _e -> do
430− lift $ warning $ "Could not read include file " ++ f ++ "."
429+ warning $ "Could not read include file " ++ f ++ "."
431 return ""
430 return ""
432 let contentLines = lines contents
431 let contentLines = lines contents
433 let numLines = length contentLines
432 let numLines = length contentLines
@@ -724,20 +723,20 @@ addNewRole roleString fields = do
725 -- warn about syntax we ignore
724 -- warn about syntax we ignore
726 flip mapM_ fields $ \(key, _) -> case key of
725 flip mapM_ fields $ \(key, _) -> case key of
727− "language" -> when (baseRole /= "code") $ lift $ P.warning $
726+ "language" -> when (baseRole /= "code") $ P.warning $
728 "ignoring :language: field because the parent of role :" ++
727 "ignoring :language: field because the parent of role :" ++
729 role ++ ": is :" ++ baseRole ++ ": not :code:"
728 role ++ ": is :" ++ baseRole ++ ": not :code:"
730− "format" -> when (baseRole /= "raw") $ lift $ P.warning $
729+ "format" -> when (baseRole /= "raw") $ P.warning $
731 "ignoring :format: field because the parent of role :" ++
730 "ignoring :format: field because the parent of role :" ++
732 role ++ ": is :" ++ baseRole ++ ": not :raw:"
731 role ++ ": is :" ++ baseRole ++ ": not :raw:"
733− _ -> lift $ P.warning $ "ignoring unknown field :" ++ key ++
732+ _ -> P.warning $ "ignoring unknown field :" ++ key ++
734 ": in definition of role :" ++ role ++ ": in"
733 ": in definition of role :" ++ role ++ ": in"
735 when (parentRole == "raw" && countKeys "format" > 1) $
734 when (parentRole == "raw" && countKeys "format" > 1) $
736− lift $ P.warning $
735+ P.warning $
737 "ignoring :format: fields after the first in the definition of role :"
736 "ignoring :format: fields after the first in the definition of role :"
738 ++ role ++": in"
737 ++ role ++": in"
739 when (parentRole == "code" && countKeys "language" > 1) $
738 when (parentRole == "code" && countKeys "language" > 1) $
740− lift $ P.warning $
739+ P.warning $
741 "ignoring :language: fields after the first in the definition of role :"
740 "ignoring :language: fields after the first in the definition of role :"
742 ++ role ++": in"
741 ++ role ++": in"