aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-01-08 21:24:41 -0800
committerJohn MacFarlane <[email protected]>2022-01-08 21:24:41 -0800
commit1b7bdb1016e2cb17346008e61ce1966bc018ceb8 (patch)
tree816df49f9e0459243c1a7c364d3eb90b6f653d75
parent8736fe11eedaacfc5794696b834d6018947681db (diff)
RST writer: avoid extra blank line after empty list item.
See #7810 (2).
-rw-r--r--src/Text/Pandoc/Writers/RST.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index d407368ca..549f0f369 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -365,7 +365,7 @@ bulletListItemToRST :: PandocMonad m => [Block] -> RST m (Doc Text)
bulletListItemToRST items = do
contents <- blockListToRST items
return $ hang 3 "- " contents $$
- if endsWithPlain items
+ if null items || endsWithPlain items
then cr
else blankline
@@ -378,7 +378,7 @@ orderedListItemToRST marker items = do
contents <- blockListToRST items
let marker' = marker <> " "
return $ hang (T.length marker') (literal marker') contents $$
- if endsWithPlain items
+ if null items || endsWithPlain items
then cr
else blankline