Closed LaurentAerens closed 4 months ago
diff_prettyHtml currently doesn't highlight leading/trailing space differences. Because spaces in HTML aren't visible.
diff_prettyHtml
This pull request changes that.
Instead of
<ins style="background:#e6ffe6;"> </ins>
diff_prettyHtml now returns
<ins style="background:#e6ffe6;"> </ins>
resulting in differences with leading/training spaces being visible in HTML.
Example: When we compare "Test" and "Test " (notice the second string doesn't equal the first string since it has a trailing space).
var diff = dmp.diff_main("Test", "Test "); // this results in the following diff: [[0, 'Test'], [1, ' ']]
Previously looked like this:
Now with this pull requests it looks like this:
Note: this issue also seems to be present in the JavaScript implementation: https://github.com/google/diff-match-patch/pull/144
Is there any potential this PR could get a review?
diff_prettyHtml
currently doesn't highlight leading/trailing space differences. Because spaces in HTML aren't visible.This pull request changes that.
Instead of
diff_prettyHtml
now returnsresulting in differences with leading/training spaces being visible in HTML.
Example: When we compare "Test" and "Test " (notice the second string doesn't equal the first string since it has a trailing space).
Previously looked like this:
Now with this pull requests it looks like this:
Note: this issue also seems to be present in the JavaScript implementation: https://github.com/google/diff-match-patch/pull/144