From 1b7bdb1016e2cb17346008e61ce1966bc018ceb8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 8 Jan 2022 21:24:41 -0800 Subject: [PATCH] RST writer: avoid extra blank line after empty list item. See #7810 (2). --- src/Text/Pandoc/Writers/RST.hs | 4 ++-- 1 file 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