Skip to content

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

Merged
ExplodingCabbage merged 1 commit intomasterfrom
fix-rendering-of-spaces-in-node-example
Jan 26, 2024
Merged

Modify node_example.js to support showing added/deleted spaces#479
ExplodingCabbage merged 1 commit intomasterfrom
fix-rendering-of-spaces-in-node-example

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