Repository navigation
Do not duplicate the closing tag when a file ends in inline content - #2561
Open
benjaminkincses wants to merge 1 commit into
Open
benjaminkincses wants to merge 1 commit into
benjaminkincses wants to merge 1 commit into
Conversation
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.
Fixes #1689.
When a file ends with an inline node and the original text ends with
?>, the printer appended a second?>at the end of the program, so every format added another one. This happens when the close tag is part of the inline node's raw text, for example a file that uses a short open tag, or trailing HTML that contains a?>.The program printer now skips the extra close tag when the last child is an inline node whose raw text already ends with
?>.Verified: the input from #1689 now formats to itself and stays stable on repeated formats. New snapshot test in tests/short-open-tag. Full suite passes (601 tests, 585 snapshots).