Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Strip left spaces from opening tags when comparing output for ch…
…anges (#5701) * fix: Strip left spaces from opening tags when comparing output for changes Spaces removed from before opening tags in both the original and new content. Fixes: rectorphp/rector#8533 * refactor: switched to ## delimiter for consistency Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com> * refactor: when comparing trimmed existing and new content, check before regex first as it can be a little slower * fix: when checking for changes, no need to ltrim the new content --------- Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
- Loading branch information
1 parent
e4b6ee6
commit bdc0907
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
5 changes: 5 additions & 0 deletions
5
tests/Issues/NoNamespaced/Fixture/open_tag_spaced_with_comment.php.inc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ul> | ||
<?php if (true) { /* comment */ ?> | ||
<li><a href="/test">test</a></li> | ||
<?php } ?> | ||
</ul> |