Repository navigation
libghostty(formatter): fix superfluous newline in html formatting - #13543
Merged
mitchellh merged 2 commits intoAug 2, 2026
Merged
Conversation
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).
jcollie
requested changes
Aug 1, 2026
jcollie
left a comment
Member
There was a problem hiding this comment.
This needs a test. Not sure what you mean by "massive blob" but that's what @embedFile is for. If it's only referenced in a test it won't affect the size of the production binary.
Contributor
Author
|
I initially thought I would have to include the whole html page I showed in my screenshots for the test, but after taking another look I realized it was just a matter of using the |
jcollie
enabled auto-merge
August 2, 2026 01:05
Contributor
Author
|
Looks like ci has passed but the merge didn't work? |
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.
In the html formatter every page is formatted in a div. When the div closes it causes 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 - as far as I could see in my testing there was always one).
I thought of trying to add a test but could not think of a way to do so without adding a massive blob of html into the file.
Before (orange was added by me to show where the div ends):

After:

No AI was used in this pr.