Skip to content

Commit

Permalink
Fix stylized-framed unfolded empty header trees
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Jan 21, 2024
1 parent 05d5ca2 commit 8795d98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/printbox-md/PrintBox_md.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ let pp c out b =
(* We cannot use Format for indentation, because we need to insert ">" at the right places. *)
let rec loop ~in_html ~prefix b =
match B.view b with
| B.Empty -> ()
| B.Empty ->
if not in_html && c.Config.frames = `Stylized then fprintf out "@,%s" prefix
| B.Text {l; style} ->
let l = break_lines l in
let multiline = List.length l > 1 in
Expand Down
2 changes: 2 additions & 0 deletions test/test_md.expected
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ Test uniform unfolded:
line 2<br>
line 3
- <span style="border:thin solid">

- <span style="border:thin solid">header 3</span>
- <span style="border:thin solid">subchild 3</span></span>
-

- <span style="border:thin solid">header 4</span>
- subchild 4
- <span style="border:thin solid"><span style="font-family: monospace">header 5</span>
Expand Down
2 changes: 2 additions & 0 deletions test/test_md.expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ Test uniform unfolded:
line 2<br>
line 3
- <span style="border:thin solid">
- <span style="border:thin solid">header 3</span>
- <span style="border:thin solid">subchild 3</span></span>
-
- <span style="border:thin solid">header 4</span>
- subchild 4
- <span style="border:thin solid"><span style="font-family: monospace">header 5</span>
Expand Down

0 comments on commit 8795d98

Please sign in to comment.