CommonMark writer: do not use simple class for fenced-divs

In https://github.com/jgm/pandoc/pull/7242, we introduced a simple attribute style for for code blocks and fenced divs with a single class but turns out the CommonMark extension does not support it for fenced divs.

https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/fenced_divs.md
This commit is contained in:
Jan Tojnar 2021-06-05 16:34:27 +02:00 committed by John MacFarlane
parent 7a3ee9d3d8
commit c550bf8482

View file

@ -322,9 +322,12 @@ blockToMarkdown' opts (Div attrs ils) = do
case () of
_ | isEnabled Ext_fenced_divs opts &&
attrs /= nullAttr ->
nowrap (literal ":::" <+> classOrAttrsToMarkdown attrs) $$
chomp contents $$
literal ":::" <> blankline
let attrsToMd = if variant == Commonmark
then attrsToMarkdown
else classOrAttrsToMarkdown
in nowrap (literal ":::" <+> attrsToMd attrs) $$
chomp contents $$
literal ":::" <> blankline
| isEnabled Ext_native_divs opts ||
(isEnabled Ext_raw_html opts &&
(variant == Commonmark ||