aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc.hs2
-rw-r--r--src/Text/Pandoc/Readers/Native.hs6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index 013a9d9ac..e5fc665a7 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -238,7 +238,7 @@ data Reader m = StringReader (ReaderOptions -> String -> m Pandoc)
-- | Association list of formats and readers.
readers :: PandocMonad m => [(String, Reader m)]
-readers = [ ("native" , StringReader $ \_ s -> readNative s)
+readers = [ ("native" , StringReader readNative)
,("json" , StringReader $ \o s ->
case readJSON o s of
Right doc -> return doc
diff --git a/src/Text/Pandoc/Readers/Native.hs b/src/Text/Pandoc/Readers/Native.hs
index 3e934e43f..1953c0c83 100644
--- a/src/Text/Pandoc/Readers/Native.hs
+++ b/src/Text/Pandoc/Readers/Native.hs
@@ -32,6 +32,7 @@ module Text.Pandoc.Readers.Native ( readNative ) where
import Text.Pandoc.Definition
import Text.Pandoc.Shared (safeRead)
+import Text.Pandoc.Options (ReaderOptions)
import Control.Monad.Except (throwError)
import Text.Pandoc.Error
@@ -48,9 +49,10 @@ import Text.Pandoc.Class
-- > Pandoc nullMeta [Plain [Str "hi"]]
--
readNative :: PandocMonad m
- => String -- ^ String to parse (assuming @'\n'@ line endings)
+ => ReaderOptions
+ -> String -- ^ String to parse (assuming @'\n'@ line endings)
-> m Pandoc
-readNative s =
+readNative _ s =
case maybe (Pandoc nullMeta <$> readBlocks s) Right (safeRead s) of
Right doc -> return doc
Left _ -> throwError $ PandocParseError "couldn't read native"