aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-07-29 18:37:07 -0700
committerJohn MacFarlane <[email protected]>2025-07-29 18:37:07 -0700
commit4066a9d483d3aac7c56009050611342d00ce1ead (patch)
tree6016a4a740f8015cde3b3cab39a42bf17c74d4b2
parentf5262d88e492802169a03efffd8c3ce292cfce9c (diff)
Asciidoc writer: handle lists with sublists following continuations.
These require an additional blank line in some cases. Closes #11006.
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs13
-rw-r--r--test/command/11006.md36
2 files changed, 47 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index 5904f7da1..333b62a74 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -438,8 +438,17 @@ addBlock opts d b = do
x <- chomp <$> blockToAsciiDoc opts b
return $
case b of
- BulletList{} -> d <> cr <> x
- OrderedList{} -> d <> cr <> x
+ BulletList{}
+ -> case d of
+ Concat (Concat _ CarriageReturn) (Text 1 "+")
+ -> d <> blankline <> x -- see #11006
+ _ -> d <> cr <> x
+ OrderedList listAttr _
+ -> case d of
+ Concat (Concat _ CarriageReturn) (Text 1 "+")
+ | (1, DefaultStyle, _) <- listAttr
+ -> d <> blankline <> x -- see #11006
+ _ -> d <> cr <> x
Para (Math DisplayMath _:_) -> d <> cr <> x
Plain (Math DisplayMath _:_) -> d <> cr <> x
Para{} | isEmpty d -> x
diff --git a/test/command/11006.md b/test/command/11006.md
new file mode 100644
index 000000000..852256747
--- /dev/null
+++ b/test/command/11006.md
@@ -0,0 +1,36 @@
+```
+% pandoc -f html -t asciidoc
+<ul>
+ <li>
+ <p>Paragraph one</p>
+ <p>Paragraph two to force a list continuation</p>
+ <ul>
+ <li>First nested</li>
+ <li>Second nested</li>
+ </ul>
+ </li>
+</ul>
+
+<p>How about ordered lists?</p>
+
+<ol>
+ <li>
+ <p>Paragraph one</p>
+ <p>Paragraph two to force a list continuation</p>
+ <ol><li>Nested item</li></ol>
+ </li>
+</ol>
+^D
+* Paragraph one
++
+Paragraph two to force a list continuation
+** First nested
+** Second nested
+
+How about ordered lists?
+
+. Paragraph one
++
+Paragraph two to force a list continuation
+.. Nested item
+```