aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-05-07 17:10:56 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2021-05-07 17:17:47 +0200
commit295d93e96b1853c2ff4658aa7206ea1329024fab (patch)
tree5e4b36cb396ee9508f75902d580535f078901727
parent8357b835d9c6d17f32bded56aa24059c2f6e0678 (diff)
downloadpandoc-295d93e96b1853c2ff4658aa7206ea1329024fab.tar.gz
ConTeXt writer: support blank lines in line blocks.
Fixes: #6564 Thanks to @denismaier.
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs8
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