Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify node_example.js to support showing added/deleted spaces #479

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

ExplodingCabbage
Copy link
Collaborator

Resolves #414

As noted there, we can't color both the background and text in green/red of different shades, like the HTML example does, because terminals only support a limited number of shades and "red" text on "bright red" background is almost completely illegible on some terminals. Therefore this PR swaps us from coloring ONLY the text to instead coloring ONLY the background. This should still clearly show what letters are added/deleted, but now also makes added/deleted spaces visible, which they weren't before.

Here's a screenshot showing the behaviour change:

image

@ExplodingCabbage ExplodingCabbage merged commit b5d1cfa into master Jan 26, 2024
@ExplodingCabbage ExplodingCabbage deleted the fix-rendering-of-spaces-in-node-example branch January 26, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug report: Why doesn't jsdiff show leading/trailing whitespace differences?
1 participant