diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-04 11:42:22 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-04 11:42:22 -0800 |
commit | 4e381e787aa0c94ee129c4364b4b8e4e699cac68 (patch) | |
tree | 658199ec36816733aa30f0395df5e40db13c8480 /src | |
parent | 7f36925c48e862b8dd7c6ae55987bceea0e83e54 (diff) | |
download | pandoc-4e381e787aa0c94ee129c4364b4b8e4e699cac68.tar.gz |
Use readMarkdownWithWarnings in Text.Pandoc.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc.hs | 13 |
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) |