Skip to content

Fix consecutive <br> collapsing into a single line break#6

Merged
koppor merged 1 commit into
mainfrom
fix-consecutive-linebreak-collapse
Jul 6, 2026
Merged

Fix consecutive <br> collapsing into a single line break#6
koppor merged 1 commit into
mainfrom
fix-consecutive-linebreak-collapse

Conversation

@koppor

@koppor koppor commented Jul 6, 2026

Copy link
Copy Markdown
Member

RichTextRenderer's Inline.LineBreak case called startParagraph(0), which only emits model.nl() when the current paragraph is "occupied". A single
correctly closes the preceding text into its own paragraph, but a second consecutive
(e.g. citation styles using

for a blank line) found the paragraph already unoccupied and silently produced nothing, collapsing the blank line.

Mark the paragraph occupied after emitting the break, mirroring the existing empty-line handling for preserved "\n\n" in appendRun.

RichTextRenderer's Inline.LineBreak case called startParagraph(0),
which only emits model.nl() when the current paragraph is "occupied".
A single <br> correctly closes the preceding text into its own
paragraph, but a second consecutive <br> (e.g. citation styles using
<br><br> for a blank line) found the paragraph already unoccupied and
silently produced nothing, collapsing the blank line.

Mark the paragraph occupied after emitting the break, mirroring the
existing empty-line handling for preserved "\n\n" in appendRun.
@koppor koppor merged commit 62c7f36 into main Jul 6, 2026
2 checks passed
@koppor koppor deleted the fix-consecutive-linebreak-collapse branch July 7, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant