php-htmldiff icon indicating copy to clipboard operation
php-htmldiff copied to clipboard

Add spaceMatching setting that matches all spaces

Open berarma opened this issue 2 years ago • 0 comments

This feature tries to provide a fix for #109. It adds a setting spaceMatching which can be set to true so spaces aren't ignored at all.

The HTML provided needs to have the meaningless spaces removed beforehand so only the spaces that we want to compare are present. I think this is more easily done by the developer using the library since it knows more about the HTML being used. The case were I want to apply it is for the code generated by a HTML editor that allows a limited set of tags with predefined layout behavior.

I've added some test cases. I haven't tested the code out of these test cases but I think it will serve my purposes well. I've created the PR so it makies its way while I get to implement it on my project. I might have overlooked something and the naming could probably be better so please make suggestions.

Thanks.

berarma avatar Aug 04 '22 10:08 berarma