Skip to content
This repository was archived by the owner on Jun 29, 2026. It is now read-only.

Commit 8bd6f3b

Browse files
committed
fix: preserve newlines between blocks in patch-bbl-template.sh
The remove_block function was consuming all trailing newlines after a removed block, causing adjacent blocks to collapse onto the same line. Now consumes exactly one trailing newline.
1 parent 0a54ead commit 8bd6f3b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ci/infrastructure/scripts/patch-bbl-template.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def remove_block(text, header):
8484
line_start = text.rfind('\n', 0, idx)
8585
if line_start == -1:
8686
line_start = 0
87-
# Include trailing newlines
8887
end = i + 1
89-
while end < len(text) and text[end] == '\n':
88+
# Consume exactly one trailing newline to avoid collapsing blocks
89+
if end < len(text) and text[end] == '\n':
9090
end += 1
91-
text = text[:line_start] + text[end:]
91+
text = text[:line_start + 1] + text[end:]
9292
break
9393
i += 1
9494
return text

0 commit comments

Comments
 (0)