Closed diesburgm closed 4 years ago
In order to simplify the implementation (and avoid a performance cost),visual-dom-diff
assumes inputs contain only relevant, normalized data. As a result, extraneous data, like redundant spaces between certain tags, leads to sub-optimal diffs. If it affects you, I'd recommend pre-processing your input documents to a format that visual-dom-diff
can handle properly. I think it is preferable over bloating the library with workarounds and options to support special cases.
I noticed on the preview page that if the an HTML table has spaces between some of the tags it always flags the table as being different.
If you add a new unit test it demonstrates this.
Results in.
Even fails if both tables have same spaces:
results in: