Skip to content

formatted rendering: keep inline element text on its own line after a block sibling - #111

Merged
sliemeobn merged 3 commits into
elementary-swift:mainfrom
Vithanco:fix/inline-text-after-block-sibling
Aug 24, 2026
Merged

formatted rendering: keep inline element text on its own line after a block sibling#111
sliemeobn merged 3 commits into
elementary-swift:mainfrom
Vithanco:fix/inline-text-after-block-sibling

Conversation

@Vithanco

@Vithanco Vithanco commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Re-submits the rendering fix from #105.

PrettyHTMLTextRenderer buffers inline content and decides at three call sites whether to force a line break before flushing it.

Vithanco and others added 3 commits August 23, 2026 10:54
…lock sibling

- PrettyHTMLTextRenderer wrote text/raw/comment straight to output when an
  inline element followed a block sibling, leaking the text before the element
- buffer inline content whenever an inline element is already open, and give
  trailing inline content its own indented line
…ock-transition points

The original fix only forced a line break when closing the parent block
tag. Pending inline content (e.g. a <span> following text after a block
sibling) still glued onto the next block-start or self-closing tag,
since those two call sites forced a break only when isInLineAfterBlockTagOpen
was true - exactly the case where there's nothing pending to flush.

Hardcode forceLineBreak: true at both remaining call sites; it's a no-op
when nothing is buffered and fixes the glueing otherwise.
@Vithanco Vithanco changed the title fix(rendering): keep inline element text inside its element after a block sibling fix(rendering): keep inline element text on its own line after a block sibling Aug 23, 2026
@Vithanco
Vithanco marked this pull request as ready for review August 23, 2026 10:28
@sliemeobn sliemeobn changed the title fix(rendering): keep inline element text on its own line after a block sibling formatted rendering: keep inline element text on its own line after a block sibling Aug 24, 2026
@sliemeobn
sliemeobn merged commit 2d36eb0 into elementary-swift:main Aug 24, 2026
9 checks passed
@sliemeobn

Copy link
Copy Markdown
Collaborator

@Vithanco thanks!

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.

2 participants