From 6893b38a6e9e634c51d6dc789db03824feedb616 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger <285675+cscheid@users.noreply.github.com> Date: Sun, 27 Jul 2025 14:27:41 -0400 Subject: Markdown writer: use fenced divs even with empty attributes. Previously fenced divs were not used in this case, causing the writer to fall back to raw HTML. Closes #10955. --- src/Text/Pandoc/Writers/Markdown.hs | 3 +-- test/command/4164.md | 6 ++--- test/writer.markdown | 54 +++++++++++++------------------------ test/writer.opml | 2 +- 4 files changed, 22 insertions(+), 43 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index cd3e4ab91..476b54286 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -400,8 +400,7 @@ blockToMarkdown' opts (Div attrs@(_,classes,_) bs) | (take 3 (T.unpack id')) == "ref" -> contents <> blankline | otherwise -> contents <> blankline - | isEnabled Ext_fenced_divs opts && - attrs /= nullAttr -> + | isEnabled Ext_fenced_divs opts -> let attrsToMd = if variant == Commonmark then attrsToMarkdown opts else classOrAttrsToMarkdown opts diff --git a/test/command/4164.md b/test/command/4164.md index 4e7b7e285..e5cf5d98e 100644 --- a/test/command/4164.md +++ b/test/command/4164.md @@ -8,11 +8,9 @@ Here is inline html: -