git.iko.soy/typeable/pandoc
on master help sign in
Implemented Ext_markdown_attribute.
78d3a0fJohn MacFarlane
@@ -2207,6 +2207,12 @@ Causes anything between `\\(` and `\\)` to be interpreted as inline
2207TeX math, and anything between `\\[` and `\\]` to be interpreted
2207TeX math, and anything between `\\[` and `\\]` to be interpreted
2208as display TeX math.
2208as display TeX math.
2209
2209
2210+**Extension: `markdown_attribute`**\
2211+Causes the attribute `markdown=1` to be added to all block-level
2212+HTML tags that might contain markdown. In pandoc, material inside
2213+block-level tags is interpreted a markdown by default, but in some
2214+other implementations, the `markdown=1` tag is needed.
2215+
2210Producing slide shows with Pandoc
2216Producing slide shows with Pandoc
2211=================================
2217=================================
2212
2218
src/Text/Pandoc/Options.hs+1
@@ -64,6 +64,7 @@ data Extension = Ext_footnotes
64 | Ext_delimited_code_blocks
64 | Ext_delimited_code_blocks
65 | Ext_inline_code_attributes
65 | Ext_inline_code_attributes
66 | Ext_markdown_in_html_blocks
66 | Ext_markdown_in_html_blocks
67+ | Ext_markdown_attribute
67 | Ext_escaped_line_breaks
68 | Ext_escaped_line_breaks
68 | Ext_autolink_code_spans
69 | Ext_autolink_code_spans
69 | Ext_fancy_lists
70 | Ext_fancy_lists
src/Text/Pandoc/Readers/Markdown.hs+10−1
@@ -736,10 +736,19 @@ rawTeXBlock = do
736 spaces
736 spaces
737 return $ return result
737 return $ return result
738
738
739+addMarkdownAttribute :: (Tag String, String) -> Parser [Char] ParserState String
740+addMarkdownAttribute (t,s) = do
741+ (guardDisabled Ext_markdown_attribute >> return s)
742+ <|> case t of
743+ TagOpen x attrs
744+ | "markdown" `elem` map fst attrs -> return s
745+ | otherwise -> return $ renderTags [TagOpen x (("markdown","1"):attrs)]
746+ _ -> return s
747+
739rawHtmlBlocks :: Parser [Char] ParserState String
748rawHtmlBlocks :: Parser [Char] ParserState String
740rawHtmlBlocks = do
749rawHtmlBlocks = do
741 htmlBlocks <- many1 $ do blk <- rawVerbatimBlock <|>
750 htmlBlocks <- many1 $ do blk <- rawVerbatimBlock <|>
742− liftM snd (htmlTag isBlockTag)
751+ (htmlTag isBlockTag >>= addMarkdownAttribute)
743 sps <- do sp1 <- many spaceChar
752 sps <- do sp1 <- many spaceChar
744 sp2 <- option "" (blankline >> return "\n")
753 sp2 <- option "" (blankline >> return "\n")
745 sp3 <- many spaceChar
754 sp3 <- many spaceChar