diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-05-07 17:10:56 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-05-07 17:17:47 +0200 |
commit | 295d93e96b1853c2ff4658aa7206ea1329024fab (patch) | |
tree | 5e4b36cb396ee9508f75902d580535f078901727 /src/Text/Pandoc/Writers | |
parent | 8357b835d9c6d17f32bded56aa24059c2f6e0678 (diff) | |
download | pandoc-295d93e96b1853c2ff4658aa7206ea1329024fab.tar.gz |
ConTeXt writer: support blank lines in line blocks.
Fixes: #6564
Thanks to @denismaier.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index f14b1d894..b694437d8 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -178,8 +178,12 @@ blockToConTeXt (Para lst) = do contents <- inlineListToConTeXt lst return $ contents <> blankline blockToConTeXt (LineBlock lns) = do - doclines <- nowrap . vcat <$> mapM inlineListToConTeXt lns - return $ "\\startlines" $$ doclines $$ "\\stoplines" <> blankline + let emptyToBlankline doc = if isEmpty doc + then blankline + else doc + doclines <- mapM inlineListToConTeXt lns + let contextLines = vcat . map emptyToBlankline $ doclines + return $ "\\startlines" $$ contextLines $$ "\\stoplines" <> blankline blockToConTeXt (BlockQuote lst) = do contents <- blockListToConTeXt lst return $ "\\startblockquote" $$ nest 0 contents $$ "\\stopblockquote" <> blankline |