diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-02-01 21:49:02 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-02-01 21:49:02 -0800 |
commit | 20a0b4433f1fa72f921b5b660a43c221926634ec (patch) | |
tree | 517fa911b333c4f7853a0e31703fd0146fc8acb5 /src/Text/Pandoc | |
parent | 633a9ecfecd7a111d6727bd4c44750dbb3c9af23 (diff) | |
download | pandoc-20a0b4433f1fa72f921b5b660a43c221926634ec.tar.gz |
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...
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 84fc77a08..7e414d9f1 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -407,7 +407,13 @@ blockToMarkdown' opts (Div attrs ils) = do isEnabled Ext_markdown_in_html_blocks opts) -> tagWithAttrs "div" attrs <> blankline <> contents <> blankline <> "</div>" <> blankline + | isEnabled Ext_raw_html opts && + isEnabled Ext_markdown_attribute opts -> + tagWithAttrs "div" attrs' <> blankline <> + contents <> blankline <> "</div>" <> blankline | otherwise -> contents <> blankline + where (id',classes',kvs') = attrs + attrs' = (id',classes',("markdown","1"):kvs') blockToMarkdown' opts (Plain inlines) = do contents <- inlineListToMarkdown opts inlines -- escape if para starts with ordered list marker |