Fix calculate_content_widths when inline boxes immediately follow a hard/explicit newline - #746
Open
nicoburns wants to merge 3 commits into
Conversation
Signed-off-by: Nico Burns <nico@nicoburns.com>
DJMcNab
reviewed
Aug 14, 2026
DJMcNab
left a comment
Member
There was a problem hiding this comment.
Unfortunately, I don't have enough context to review this. It does look a bit suspect - the whitespace_advance(prev_atom) looks like it might be happening twice?
Comment on lines
+123
to
+128
| /// | ||
| /// The mandatory break used to be detected via the boundary flag on the text | ||
| /// atom *after* the break, so inline boxes between the newline and that atom | ||
| /// were attributed to the line *before* the break, under-reporting the max | ||
| /// content width. In Blitz this caused inline-block links following a `<br>` | ||
| /// to wrap inside a shrink-to-fit container even though they fit on one line. |
Member
There was a problem hiding this comment.
Suggested change
| /// | |
| /// The mandatory break used to be detected via the boundary flag on the text | |
| /// atom *after* the break, so inline boxes between the newline and that atom | |
| /// were attributed to the line *before* the break, under-reporting the max | |
| /// content width. In Blitz this caused inline-block links following a `<br>` | |
| /// to wrap inside a shrink-to-fit container even though they fit on one line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Contributions: Bug identified and code generated with Devin Ultra.
Fix
calculate_content_widthswhen an inline boxes immediately follows a hard/explicit newline. They were previously incorrectly counted as being before the newline because the "Mandatory Break" is only set on the character following the line break. This change mirrors what the line-breaking is already doing into the content width calculation.Changelog