diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-31 13:23:30 +0300 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-11-03 10:17:32 -0700 |
commit | 5686bdfc97caae0d835629a2b14beed17be5f270 (patch) | |
tree | ab3333d966c7da99b1607514d6166a1a5f2fd885 | |
parent | e5cc24fb6171f0befe4d1f0a5a7b7d5194cfd72b (diff) | |
download | pandoc-5686bdfc97caae0d835629a2b14beed17be5f270.tar.gz |
Creole reader: parse Text without converting to [Char]
-rw-r--r-- | src/Text/Pandoc/Readers/Creole.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Creole.hs b/src/Text/Pandoc/Readers/Creole.hs index a337bf937..040ce3650 100644 --- a/src/Text/Pandoc/Readers/Creole.hs +++ b/src/Text/Pandoc/Readers/Creole.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} {- Copyright (C) 2017 Sascha Wilde <wilde@sha-bang.de> @@ -41,7 +42,6 @@ import Control.Monad.Except (guard, liftM2, throwError) import qualified Data.Foldable as F import Data.Maybe (fromMaybe) import Data.Text (Text) -import qualified Data.Text as T import qualified Text.Pandoc.Builder as B import Text.Pandoc.Class (PandocMonad (..)) import Text.Pandoc.Definition @@ -56,13 +56,12 @@ readCreole :: PandocMonad m -> Text -> m Pandoc readCreole opts s = do - res <- readWithM parseCreole def{ stateOptions = opts } - (T.unpack (crFilter s) ++ "\n\n") + res <- readWithM parseCreole def{ stateOptions = opts } $ crFilter s <> "\n\n" case res of Left e -> throwError e Right d -> return d -type CRLParser = ParserT [Char] ParserState +type CRLParser = ParserT Text ParserState -- -- Utility functions |