aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 9a4acb59d..ad8d5c483 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -847,6 +847,13 @@ blockListToMarkdown opts blocks = do
Plain ils : fixBlocks bs
fixBlocks (Plain ils : bs) =
Para ils : fixBlocks bs
+ fixBlocks (r@(RawBlock f raw) : b : bs)
+ | not (null raw)
+ , last raw /= '\n' =
+ case b of
+ Plain{} -> r : fixBlocks (b:bs)
+ RawBlock{} -> r : fixBlocks (b:bs)
+ _ -> RawBlock f (raw ++ "\n") : fixBlocks (b:bs) -- #4629
fixBlocks (x : xs) = x : fixBlocks xs
fixBlocks [] = []
isListBlock (BulletList _) = True