@@ -37,6 +37,7 @@ import Data.Char ( isAlphaNum )
3737import Data.Maybe
3838import Text.Pandoc.Definition
3939import Text.Pandoc.Generic
40+import Text.Pandoc.Options
4041import Text.Pandoc.Shared
4142import Text.Pandoc.Parsing
4243import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
@@ -181,7 +182,7 @@ parseMarkdown = do
181182 -- docMinusKeys is the raw document with blanks where the keys/notes were...
182183 st <- getState
183184 let firstPassParser = referenceKey
184− <|> (if stateStrict st then mzero else noteBlock)
185+ <|> (if optionStrict (stateOptions st) then mzero else noteBlock)
185186 <|> liftM snd (withRaw codeBlockDelimited)
186187 <|> lineClump
187188 docMinusKeys <- liftM concat $ manyTill firstPassParser eof
@@ -292,7 +293,7 @@ parseBlocks = manyTill block eof
292293block :: Parser [Char] ParserState Block
293294block = do
294295 st <- getState
295− choice (if stateStrict st
296+ choice (if optionStrict (stateOptions st)
296297 then [ header
297298 , codeBlockIndented
298299 , blockQuote
@@ -533,7 +534,7 @@ anyOrderedListStart = try $ do
533534 skipNonindentSpaces
534535 notFollowedBy $ string "p." >> spaceChar >> digit -- page number
535536 state <- getState
536− if stateStrict state
537+ if optionStrict (stateOptions state)
537538 then do many1 digit
538539 char '.'
539540 spaceChar
@@ -694,7 +695,7 @@ para = try $ do
694695 option (Plain result) $ try $ do
695696 newline
696697 blanklines <|>
697− (getState >>= guard . stateStrict >>
698+ (getState >>= guard . optionStrict . stateOptions >>
698699 lookAhead (blockQuote <|> header) >> return "")
699700 return $ Para result
700701
@@ -1008,7 +1009,7 @@ escapedChar' :: Parser [Char] ParserState Char
10081009escapedChar' = try $ do
10091010 char '\\'
10101011 state <- getState
1011− if stateStrict state
1012+ if optionStrict (stateOptions state)
10121013 then oneOf "\\`*_{}[]()>#+-.!~"
10131014 else satisfy (not . isAlphaNum)
10141015
@@ -1023,7 +1024,7 @@ escapedChar = do
10231024ltSign :: Parser [Char] ParserState Inline
10241025ltSign = do
10251026 st <- getState
1026− if stateStrict st
1027+ if optionStrict (stateOptions st)
10271028 then char '<'
10281029 else notFollowedBy' rawHtmlBlocks >> char '<' -- unless it starts html
10291030 return $ Str ['<']
@@ -1159,7 +1160,7 @@ nonEndline = satisfy (/='\n')
11591160
11601161str :: Parser [Char] ParserState Inline
11611162str = do
1162− smart <- stateSmart `fmap` getState
1163+ smart <- (optionSmart . stateOptions) `fmap` getState
11631164 a <- alphaNum
11641165 as <- many $ alphaNum
11651166 <|> (try $ char '_' >>~ lookAhead alphaNum)
@@ -1200,7 +1201,7 @@ endline = try $ do
12001201 newline
12011202 notFollowedBy blankline
12021203 st <- getState
1203− when (stateStrict st) $ do
1204+ when (optionStrict (stateOptions st)) $ do
12041205 notFollowedBy emailBlockQuoteStart
12051206 notFollowedBy (char '#') -- atx header
12061207 -- parse potential list-starts differently if in a list:
@@ -1282,7 +1283,7 @@ autoLink = try $ do
12821283 (orig, src) <- uri <|> emailAddress
12831284 char '>'
12841285 st <- getState
1285− return $ if stateStrict st
1286+ return $ if optionStrict (stateOptions st)
12861287 then Link [Str orig] (src, "")
12871288 else Link [Code ("",["url"],[]) orig] (src, "")
12881289
@@ -1343,7 +1344,7 @@ inBrackets parser = do
13431344rawHtmlInline :: Parser [Char] ParserState Inline
13441345rawHtmlInline = do
13451346 st <- getState
1346− (_,result) <- if stateStrict st
1347+ (_,result) <- if optionStrict (stateOptions st)
13471348 then htmlTag (not . isTextTag)
13481349 else htmlTag isInlineTag
13491350 return $ RawInline "html" result