@@ -37,7 +37,6 @@ import Text.Pandoc.Shared
3737import Text.Pandoc.Parsing
3838import Text.Pandoc.Options
3939import Text.Pandoc.Error
40−import qualified Text.Pandoc.UTF8 as UTF8
4140import Control.Monad ( when, liftM, guard, mzero )
4241import Data.List ( findIndex, intercalate, isInfixOf,
4342 transpose, sort, deleteFirstsBy, isSuffixOf , nub, union)
@@ -49,8 +48,9 @@ import qualified Text.Pandoc.Builder as B
4948import Data.Sequence (viewr, ViewR(..))
5049import Data.Char (toLower, isHexDigit, isSpace)
5150import Data.Monoid ((<>))
52−import Control.Monad.Except (throwError, catchError)
53−import Text.Pandoc.Class (PandocMonad, warning, readFileLazy, warningWithPos)
51+import Control.Monad.Except (throwError)
52+import Text.Pandoc.Class (PandocMonad, warning, readFileFromDirs,
53+ warningWithPos)
5454
5555-- | Parse reStructuredText string and return Pandoc document.
5656readRST :: PandocMonad m
@@ -421,12 +421,7 @@ include = try $ do
421421 when (f `elem` containers) $
422422 throwError $ PandocParseError $ "Include file loop at " ++ show oldPos
423423 updateState $ \s -> s{ stateContainers = f : stateContainers s }
424− res <- readFileLazy' f
425− contents <- case res of
426− Right x -> return x
427− Left _e -> do
428− warning $ "Could not read include file " ++ f ++ "."
429− return ""
424+ contents <- readFileFromDirs ["."] f
430425 let contentLines = lines contents
431426 let numLines = length contentLines
432427 let startLine' = case startLine of
@@ -470,9 +465,6 @@ include = try $ do
470465 tail $ stateContainers s }
471466 return bs
472467
473−readFileLazy' :: PandocMonad m => FilePath -> m (Either PandocError String)
474−readFileLazy' f = catchError ((Right . UTF8.toStringLazy) <$> readFileLazy f) $
475− \(e :: PandocError) -> return (Left e)
476468
477469--
478470-- list blocks