git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: use markdown="1" when appropriate for Divs.

When `native_divs` and `markdown_in_html_blocks` are disabled but `raw_html` and `markdown_attribute` are enabled...

commit20a0b4433f1fa72f921b5b660a43c221926634ec authorJohn MacFarlane <jgm@berkeley.edu> dateFri 1 Feb 2019, 21:49 (8 years ago) parent633a9ec
1 file changed+6
src/Text/Pandoc/Writers/Markdown.hs+6
src/Text/Pandoc/Writers/Markdown.hs+6
@@ -407,7 +407,13 @@ blockToMarkdown' opts (Div attrs ils) = do
407407 isEnabled Ext_markdown_in_html_blocks opts) ->
408408 tagWithAttrs "div" attrs <> blankline <>
409409 contents <> blankline <> "</div>" <> blankline
410+ | isEnabled Ext_raw_html opts &&
411+ isEnabled Ext_markdown_attribute opts ->
412+ tagWithAttrs "div" attrs' <> blankline <>
413+ contents <> blankline <> "</div>" <> blankline
410414 | otherwise -> contents <> blankline
415+ where (id',classes',kvs') = attrs
416+ attrs' = (id',classes',("markdown","1"):kvs')
411417blockToMarkdown' opts (Plain inlines) = do
412418 contents <- inlineListToMarkdown opts inlines
413419 -- escape if para starts with ordered list marker