@@ -939,10 +939,21 @@ htmlBlock = do
939939 (TagOpen t attrs) <- lookAhead $ fst <$> htmlTag isBlockTag
940940 (guard (t `elem` ["pre","style","script"]) >>
941941 (return . B.rawBlock "html") <$> rawVerbatimBlock)
942− <|> (guardEnabled Ext_markdown_attribute >>
943− case lookup "markdown" attrs of
944− Just "1" -> rawHtmlBlocks
945− _ -> htmlBlock')
942+ <|> (do guardEnabled Ext_markdown_attribute
943+ oldMarkdownAttribute <- stateMarkdownAttribute <$> getState
944+ markdownAttribute <-
945+ case lookup "markdown" attrs of
946+ Just "0" -> False <$ updateState (\st -> st{
947+ stateMarkdownAttribute = False })
948+ Just _ -> True <$ updateState (\st -> st{
949+ stateMarkdownAttribute = True })
950+ Nothing -> return oldMarkdownAttribute
951+ res <- if markdownAttribute
952+ then rawHtmlBlocks
953+ else htmlBlock'
954+ updateState $ \st -> st{ stateMarkdownAttribute =
955+ oldMarkdownAttribute }
956+ return res)
946957 <|> (guardEnabled Ext_markdown_in_html_blocks >> rawHtmlBlocks))
947958 <|> htmlBlock'
948959