aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-21 21:55:19 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-21 21:55:19 +0000
commit9b664073d5729b875b7661a0f96654ff240a3f73 (patch)
tree6ef1784d884fad52ea4b726ad761fd47f88e5853 /src
parent86453926b665c25747c3a699740ef8d9e9e2e9c6 (diff)
downloadpandoc-9b664073d5729b875b7661a0f96654ff240a3f73.tar.gz
Moved failIfStrict from Markdown reader to
Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@750 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Shared.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 06c1b89c3..f1df22c4f 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -57,6 +57,7 @@ module Text.Pandoc.Shared (
NoteTable,
defaultParserState,
nullBlock,
+ failIfStrict,
escaped,
-- * Native format prettyprinting
prettyPandoc,
@@ -184,6 +185,12 @@ nullBlock = do
anyChar
return Null
+-- | Fail if reader is in strict markdown syntax mode.
+failIfStrict :: GenParser Char ParserState ()
+failIfStrict = do
+ state <- getState
+ if stateStrict state then fail "Strict mode" else return ()
+
-- | Parses backslash, then applies character parser.
escaped :: GenParser Char st Char -- ^ Parser for character to escape
-> GenParser Char st Inline