From f024d21fc46ab2110ef6573f7f5ea5263330cad7 Mon Sep 17 00:00:00 2001 From: Roni Jacobson Date: Fri, 31 Jul 2026 18:59:47 +0300 Subject: [PATCH] Fix superfluous newline in html formatting Every page is formatted in a div, and when the div closes it creates a newline in the html rendering. In order to fix this a newline is now removed whenever the div is closed (if there are any newlines waiting to be rendered). --- src/terminal/formatter.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/terminal/formatter.zig b/src/terminal/formatter.zig index f8cf61e64..f76b865c9 100644 --- a/src/terminal/formatter.zig +++ b/src/terminal/formatter.zig @@ -1354,6 +1354,9 @@ pub const PageFormatter = struct { closing.len, ); } + // Closing the div creates a newline in the output + // so make sure to create one less newline + if (blank_rows >= 1) blank_rows -= 1; } return .{ .rows = blank_rows, .cells = blank_cells };