aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-04 11:42:22 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-04 11:42:22 -0800
commit4e381e787aa0c94ee129c4364b4b8e4e699cac68 (patch)
tree658199ec36816733aa30f0395df5e40db13c8480 /src
parent7f36925c48e862b8dd7c6ae55987bceea0e83e54 (diff)
downloadpandoc-4e381e787aa0c94ee129c4364b4b8e4e699cac68.tar.gz
Use readMarkdownWithWarnings in Text.Pandoc.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index 18ca069d3..ca4a1e02b 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -140,7 +140,7 @@ import Text.Pandoc.Writers.Org
import Text.Pandoc.Writers.AsciiDoc
import Text.Pandoc.Templates
import Text.Pandoc.Options
-import Text.Pandoc.Shared (safeRead)
+import Text.Pandoc.Shared (safeRead, warn)
import Data.ByteString.Lazy (ByteString)
import Data.List (intercalate)
import Data.Version (showVersion)
@@ -179,8 +179,15 @@ parseFormatSpec = parse formatSpec ""
readers :: [(String, ReaderOptions -> String -> IO Pandoc)]
readers = [("native" , \_ s -> return $ readNative s)
,("json" , \_ s -> return $ decodeJSON s)
- ,("markdown_strict" , \o s -> return $ readMarkdown o s)
- ,("markdown" , \o s -> return $ readMarkdown o s)
+ ,("markdown_strict" , \o s -> do
+ let (doc, warnings) = readMarkdownWithWarnings
+ o{ readerExtensions = strictExtensions } s
+ mapM_ warn warnings
+ return doc)
+ ,("markdown" , \o s -> do
+ let (doc, warnings) = readMarkdownWithWarnings o s
+ mapM_ warn warnings
+ return doc)
,("rst" , \o s -> return $ readRST o s)
,("mediawiki" , \o s -> return $ readMediaWiki o s)
,("docbook" , \o s -> return $ readDocBook o s)