diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-10-23 09:25:07 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-10-23 09:25:07 -0700 |
commit | efc6994c8a792e72ae299bc33e18327c3c4acbc9 (patch) | |
tree | 0acfd24b745158c1cc095a11b000a5a8e1882983 /src/Text | |
parent | 0cd0627f02e1fe4a138861c5e83692c4fe2c85e0 (diff) | |
download | pandoc-efc6994c8a792e72ae299bc33e18327c3c4acbc9.tar.gz |
Commonmark writer: fix regression with fenced divs.
Starting with 2.10.1, fenced divs no longer render with
HTML div tags in commonmark output. This is a regression
due to our transition from cmark-gfm. This commit fixes it.
Closes #6768.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 55f67b228..0aca83ad0 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -419,6 +419,7 @@ blockToMarkdown' :: PandocMonad m blockToMarkdown' _ Null = return empty blockToMarkdown' opts (Div attrs ils) = do contents <- blockListToMarkdown opts ils + variant <- asks envVariant return $ case () of _ | isEnabled Ext_fenced_divs opts && @@ -428,7 +429,8 @@ blockToMarkdown' opts (Div attrs ils) = do literal ":::" <> blankline | isEnabled Ext_native_divs opts || (isEnabled Ext_raw_html opts && - isEnabled Ext_markdown_in_html_blocks opts) -> + (variant == Commonmark || + isEnabled Ext_markdown_in_html_blocks opts)) -> tagWithAttrs "div" attrs <> blankline <> contents <> blankline <> "</div>" <> blankline | isEnabled Ext_raw_html opts && |