diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-14 17:12:06 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-14 17:12:06 -0700 |
commit | 88faa45f1d294690ad97b7f45a75c89c65227cf1 (patch) | |
tree | 653a304d5c6f5b3c5f5c9234662ba6998a3d70f4 /src | |
parent | ab3e41c8224db35a1617b5c4be39c14fc20dc583 (diff) | |
download | pandoc-88faa45f1d294690ad97b7f45a75c89c65227cf1.tar.gz |
Markdown writer: ensure blank between raw block and normal content.
Otherwise a raw block can prevent a paragraph from being
recognized as such.
Closes #4629.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 7 |
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 |