aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs6
-rw-r--r--src/Text/Pandoc/Readers/Roff.hs2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index d53ea129b..788744db3 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -198,7 +198,6 @@ where
import Prelude
import Control.Monad.Identity
-import Control.Monad.Loops (unfoldM)
import Control.Monad.Reader
import Data.Char (chr, isAlphaNum, isAscii, isAsciiUpper,
isPunctuation, isSpace, ord, toLower, toUpper)
@@ -222,7 +221,6 @@ import Text.Pandoc.Shared
import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)
import Text.Pandoc.XML (fromEntities)
import Text.Parsec hiding (token)
-import qualified Text.Parsec (uncons)
import Text.Parsec.Pos (initialPos, newPos, updatePosString)
import Control.Monad.Except
@@ -1056,10 +1054,10 @@ readWithM parser state input = do
case res of
Right x -> return $ Right x
Left e -> do
- inp <- map fst <$> unfoldM (Text.Parsec.uncons input)
+ inp <- either (const "") id
+ <$> runParserT (many1 anyChar) state "source" input
return $ Left $ PandocParsecError inp e
-
-- | Parse a string with a given parser and state
readWith :: Parser [Char] st a
-> st
diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs
index d46ddd103..632578da7 100644
--- a/src/Text/Pandoc/Readers/Roff.hs
+++ b/src/Text/Pandoc/Readers/Roff.hs
@@ -53,7 +53,7 @@ import Prelude
import Safe (lastDef)
import Control.Monad (void, mzero, mplus, guard)
import Control.Monad.Except (throwError)
-import Control.Monad.State.Strict (StateT(..), evalStateT, get, modify, put)
+import Control.Monad.State (StateT(..), evalStateT, get, modify, put)
import Text.Pandoc.Class
(getResourcePath, readFileFromDirs, PandocMonad(..), report)
import Data.Char (isLower, toLower, toUpper, chr,