Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Conversation

@54mu3l
Copy link

diff_prettyHtml currently doesn't highlight leading/trailing space differences. Because spaces in HTML aren't visible.

This pull request changes that.

Instead of

<insstyle="background:#e6ffe6;"></ins>

diff_prettyHtml now returns

<insstyle="background:#e6ffe6;">&nbsp;</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).

vardiff=dmp.diff_main("Test","Test ");// this results in the following diff: [[0, 'Test'], [1, ' ']]

Previously looked like this:
image

Now with this pull requests it looks like this:
image

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@54mu3l