diff options
| author | Evan Silberman <[email protected]> | 2024-11-11 14:07:07 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-11-11 16:00:47 -0800 |
| commit | a4b859115036688a2e23d41ce2c6a2d047862662 (patch) | |
| tree | bfa52c202e2f3a1f19a869ed261dc9281d129129 | |
| parent | fdef25eb6ed376826c3efade41f346340939831e (diff) | |
Respect empty LineBlock lines in ANSI writer
| -rw-r--r-- | src/Text/Pandoc/Writers/ANSI.hs | 6 | ||||
| -rw-r--r-- | test/ansi-test.ansi | 4 | ||||
| -rw-r--r-- | test/ansi-test.txt | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/ANSI.hs b/src/Text/Pandoc/Writers/ANSI.hs index 962560422..92c8e0af8 100644 --- a/src/Text/Pandoc/Writers/ANSI.hs +++ b/src/Text/Pandoc/Writers/ANSI.hs @@ -124,7 +124,11 @@ blockToANSI opts (Plain inlines) = inlineListToANSI opts inlines blockToANSI opts (Para inlines) = inlineListToANSI opts inlines -blockToANSI opts (LineBlock lns) = blockToANSI opts $ linesToPara lns +blockToANSI opts (LineBlock lns) = do + let go [] = return D.blankline + go xs = inlineListToANSI opts xs + lns' <- mapM go lns + return $ D.vcat lns' blockToANSI _ b@(RawBlock _ _) = do report $ BlockNotRendered b diff --git a/test/ansi-test.ansi b/test/ansi-test.ansi index 691ed561d..57147eacc 100644 --- a/test/ansi-test.ansi +++ b/test/ansi-test.ansi @@ -113,6 +113,10 @@ small caps We see a log₁₀ reduction in 2⁹ seconds. +Hello + +Goodbye + ──────────────────── 1. Here’s the note.[0m]8;;\ diff --git a/test/ansi-test.txt b/test/ansi-test.txt index a812629a7..4e6f9800c 100644 --- a/test/ansi-test.txt +++ b/test/ansi-test.txt @@ -121,3 +121,7 @@ More text. [small caps]{.smallcaps} We see a log~10~ reduction in 2^9^ seconds. + +| Hello +| +| Goodbye |
