@@ -37,6 +37,7 @@ import Data.Char ( isAlphaNum )
37import Data.Maybe
37import Data.Maybe
38import Text.Pandoc.Definition
38import Text.Pandoc.Definition
39import Text.Pandoc.Generic
39import Text.Pandoc.Generic
40+import Text.Pandoc.Options
40import Text.Pandoc.Shared
41import Text.Pandoc.Shared
41import Text.Pandoc.Parsing
42import Text.Pandoc.Parsing
42import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
43import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
@@ -181,7 +182,7 @@ parseMarkdown = do
181 -- docMinusKeys is the raw document with blanks where the keys/notes were...
182 -- docMinusKeys is the raw document with blanks where the keys/notes were...
182 st <- getState
183 st <- getState
183 let firstPassParser = referenceKey
184 let firstPassParser = referenceKey
184− <|> (if stateStrict st then mzero else noteBlock)
185+ <|> (if optionStrict (stateOptions st) then mzero else noteBlock)
185 <|> liftM snd (withRaw codeBlockDelimited)
186 <|> liftM snd (withRaw codeBlockDelimited)
186 <|> lineClump
187 <|> lineClump
187 docMinusKeys <- liftM concat $ manyTill firstPassParser eof
188 docMinusKeys <- liftM concat $ manyTill firstPassParser eof
@@ -292,7 +293,7 @@ parseBlocks = manyTill block eof
292block :: Parser [Char] ParserState Block
293block :: Parser [Char] ParserState Block
293block = do
294block = do
294 st <- getState
295 st <- getState
295− choice (if stateStrict st
296+ choice (if optionStrict (stateOptions st)
296 then [ header
297 then [ header
297 , codeBlockIndented
298 , codeBlockIndented
298 , blockQuote
299 , blockQuote
@@ -533,7 +534,7 @@ anyOrderedListStart = try $ do
533 skipNonindentSpaces
534 skipNonindentSpaces
534 notFollowedBy $ string "p." >> spaceChar >> digit -- page number
535 notFollowedBy $ string "p." >> spaceChar >> digit -- page number
535 state <- getState
536 state <- getState
536− if stateStrict state
537+ if optionStrict (stateOptions state)
537 then do many1 digit
538 then do many1 digit
539 spaceChar
540 spaceChar
@@ -694,7 +695,7 @@ para = try $ do
694 option (Plain result) $ try $ do
695 option (Plain result) $ try $ do
696 blanklines <|>
697 blanklines <|>
697− (getState >>= guard . stateStrict >>
698+ (getState >>= guard . optionStrict . stateOptions >>
698 lookAhead (blockQuote <|> header) >> return "")
699 lookAhead (blockQuote <|> header) >> return "")
699 return $ Para result
700 return $ Para result
@@ -1008,7 +1009,7 @@ escapedChar' :: Parser [Char] ParserState Char
1008escapedChar' = try $ do
1009escapedChar' = try $ do
1009 char '\\'
1010 char '\\'
1010 state <- getState
1011 state <- getState
1011− if stateStrict state
1012+ if optionStrict (stateOptions state)
1012 then oneOf "\\`*_{}[]()>#+-.!~"
1013 then oneOf "\\`*_{}[]()>#+-.!~"
1013 else satisfy (not . isAlphaNum)
1014 else satisfy (not . isAlphaNum)
@@ -1023,7 +1024,7 @@ escapedChar = do
1023ltSign :: Parser [Char] ParserState Inline
1024ltSign :: Parser [Char] ParserState Inline
1024ltSign = do
1025ltSign = do
1025 st <- getState
1026 st <- getState
1026− if stateStrict st
1027+ if optionStrict (stateOptions st)
1027 then char '<'
1028 then char '<'
1028 else notFollowedBy' rawHtmlBlocks >> char '<' -- unless it starts html
1029 else notFollowedBy' rawHtmlBlocks >> char '<' -- unless it starts html
1029 return $ Str ['<']
1030 return $ Str ['<']
@@ -1159,7 +1160,7 @@ nonEndline = satisfy (/='\n')
1160str :: Parser [Char] ParserState Inline
1161str :: Parser [Char] ParserState Inline
1162− smart <- stateSmart `fmap` getState
1163+ smart <- (optionSmart . stateOptions) `fmap` getState
1163 a <- alphaNum
1164 a <- alphaNum
1164 as <- many $ alphaNum
1165 as <- many $ alphaNum
1165 <|> (try $ char '_' >>~ lookAhead alphaNum)
1166 <|> (try $ char '_' >>~ lookAhead alphaNum)
@@ -1200,7 +1201,7 @@ endline = try $ do
1201 notFollowedBy blankline
1202 notFollowedBy blankline
1202 st <- getState
1203 st <- getState
1203− when (stateStrict st) $ do
1204+ when (optionStrict (stateOptions st)) $ do
1204 notFollowedBy emailBlockQuoteStart
1205 notFollowedBy emailBlockQuoteStart
1205 notFollowedBy (char '#') -- atx header
1206 notFollowedBy (char '#') -- atx header
1206 -- parse potential list-starts differently if in a list:
1207 -- parse potential list-starts differently if in a list:
@@ -1282,7 +1283,7 @@ autoLink = try $ do
1282 (orig, src) <- uri <|> emailAddress
1283 (orig, src) <- uri <|> emailAddress
1283 char '>'
1284 char '>'
1284 st <- getState
1285 st <- getState
1285− return $ if stateStrict st
1286+ return $ if optionStrict (stateOptions st)
1286 then Link [Str orig] (src, "")
1287 then Link [Str orig] (src, "")
1287 else Link [Code ("",["url"],[]) orig] (src, "")
1288 else Link [Code ("",["url"],[]) orig] (src, "")
@@ -1343,7 +1344,7 @@ inBrackets parser = do
1343rawHtmlInline :: Parser [Char] ParserState Inline
1344rawHtmlInline :: Parser [Char] ParserState Inline
1344rawHtmlInline = do
1345rawHtmlInline = do
1345 st <- getState
1346 st <- getState
1346− (_,result) <- if stateStrict st
1347+ (_,result) <- if optionStrict (stateOptions st)
1347 then htmlTag (not . isTextTag)
1348 then htmlTag (not . isTextTag)
1348 else htmlTag isInlineTag
1349 else htmlTag isInlineTag
1349 return $ RawInline "html" result
1350 return $ RawInline "html" result