diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Options.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index f7f07a939..6d235e7a8 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -64,6 +64,7 @@ data Extension = Ext_footnotes | Ext_delimited_code_blocks | Ext_inline_code_attributes | Ext_markdown_in_html_blocks + | Ext_markdown_attribute | Ext_escaped_line_breaks | Ext_autolink_code_spans | Ext_fancy_lists diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 8a1299de6..fbcdeeb14 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -736,10 +736,19 @@ rawTeXBlock = do spaces return $ return result +addMarkdownAttribute :: (Tag String, String) -> Parser [Char] ParserState String +addMarkdownAttribute (t,s) = do + (guardDisabled Ext_markdown_attribute >> return s) + <|> case t of + TagOpen x attrs + | "markdown" `elem` map fst attrs -> return s + | otherwise -> return $ renderTags [TagOpen x (("markdown","1"):attrs)] + _ -> return s + rawHtmlBlocks :: Parser [Char] ParserState String rawHtmlBlocks = do htmlBlocks <- many1 $ do blk <- rawVerbatimBlock <|> - liftM snd (htmlTag isBlockTag) + (htmlTag isBlockTag >>= addMarkdownAttribute) sps <- do sp1 <- many spaceChar sp2 <- option "" (blankline >> return "\n") sp3 <- many spaceChar |