This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
[JavaScript] diff_prettyHtml highlight leading/trailing space difference #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andTest
(notice the second string doesn't equal the first string since it has a trailing space).Previously looked like this:
![image](https://private-user-images.githubusercontent.com/17022670/242906142-5ebd2764-0129-49f0-b3c0-ec77319316f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDI4NDcsIm5iZiI6MTczOTYwMjU0NywicGF0aCI6Ii8xNzAyMjY3MC8yNDI5MDYxNDItNWViZDI3NjQtMDEyOS00OWYwLWIzYzAtZWM3NzMxOTMxNmYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2NTU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM4ZjQ1ZTU3ZmJkMzFlNDI0OTRjNzUwNDJlZjEwOWYzZjMzMmM2NTE0YjNmYzZmYmQzNzE1YmQwNGRiNjkwZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZMRoR07GMu3wvAB4EfOGLUX1kci-Cc0LjpyqTwIobPI)
Now with this pull requests it looks like this:
![image](https://private-user-images.githubusercontent.com/17022670/242906167-f99add6a-79c2-42f5-8286-fa043903b9f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDI4NDcsIm5iZiI6MTczOTYwMjU0NywicGF0aCI6Ii8xNzAyMjY3MC8yNDI5MDYxNjctZjk5YWRkNmEtNzljMi00MmY1LTgyODYtZmEwNDM5MDNiOWY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2NTU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjMGM5OTY5MzQxYmExNmI1MmEyYzAyNzkxNmRkN2JkZTAyZTAxODRkOTgwNzMxZjRlMzg5MDE0YzA3NThkYzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QuwH7nUvPmnfQ-ceBh5K0b1thvflMYLA9bUJbW31WKQ)