@@ -555,7 +555,14 @@ bulletListItemToMarkdown opts items = do
555 contents <- blockListToMarkdown opts items
555 contents <- blockListToMarkdown opts items
556 let sps = replicate (writerTabStop opts - 2) ' '
556 let sps = replicate (writerTabStop opts - 2) ' '
557 let start = text ('-' : ' ' : sps)
557 let start = text ('-' : ' ' : sps)
558+ -- remove trailing blank line if it is a tight list
559+ let contents' = case reverse items of
560+ (BulletList xs:_) | isTightList xs ->
561+ chomp contents <> cr
562+ (OrderedList _ xs:_) | isTightList xs ->
563+ chomp contents <> cr
558− return $ hang (writerTabStop opts) start $ contents <> cr
565+ return $ hang (writerTabStop opts) start $ contents' <> cr
560-- | Convert ordered list item (a list of blocks) to markdown.
567-- | Convert ordered list item (a list of blocks) to markdown.
561orderedListItemToMarkdown :: WriterOptions -- ^ options
568orderedListItemToMarkdown :: WriterOptions -- ^ options