Skip to content

Commit

Permalink
Respect empty LineBlock lines in ANSI writer
Browse files Browse the repository at this point in the history
  • Loading branch information
silby authored and jgm committed Nov 12, 2024
1 parent fdef25e commit a4b8591
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Text/Pandoc/Writers/ANSI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/ansi-test.ansi
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ small caps

We see a log₁₀ reduction in 2⁹ seconds.

Hello

Goodbye

────────────────────

1. Here’s the note.]8;;\
4 changes: 4 additions & 0 deletions test/ansi-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ More text.
[small caps]{.smallcaps}

We see a log~10~ reduction in 2^9^ seconds.

| Hello
|
| Goodbye

0 comments on commit a4b8591

Please sign in to comment.