Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Oct 6, 2021

When non-empty inline HTML is on the same line, before the scope closing, the sniff would incorrectly throw the Closing brace indented incorrectly; expected %s spaces, found %s error, instead of the Closing brace must be on a line by itself error.

This would ultimately lead to the fixer removing the non-empty inline HTML, potentially breaking HTML display/structure.

Fixed now. Includes unit test.

Fixes #3422

…fixing

When non-empty inline HTML is on the same line, before the scope closing, the sniff would incorrectly throw the `Closing brace indented incorrectly; expected %s spaces, found %s` error, instead of the `Closing brace must be on a line by itself` error.

This would ultimately lead to the fixer removing the non-empty inline HTML, potentially breaking HTML display/structure.

Fixed now. Includes unit test.

Fixes 3422
@gsherwood gsherwood added this to the 3.6.2 milestone Oct 11, 2021
gsherwood added a commit that referenced this pull request Nov 1, 2021
@gsherwood gsherwood merged commit 5de91bb into squizlabs:master Nov 1, 2021
@gsherwood
Copy link
Member

Thanks a lot for fixing this. Assuming inline HTML is always empty was not some of my best work...

@jrfnl jrfnl deleted the feature/3422-squiz-scopeclosingbrace-bug-fix branch November 1, 2021 01:33
@jrfnl
Copy link
Contributor Author

jrfnl commented Nov 1, 2021

Thanks a lot for fixing this. Assuming inline HTML is always empty was not some of my best work...

Well, the original sniff is pretty ancient (from the initial import), so from well before the fixer functionality was available, so not that surprising that something like this slipped through the cracks.

What is surprising is that no other bug reports about this had been filed in the seven years since the fixers got added 😂

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.

Squiz.WhiteSpace.ScopeClosingBrace fixer removes HTML content when fixing closing brace alignment

2 participants