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

Making whitespace the only word separator? #214

Open
rococode opened this issue Feb 12, 2018 · 1 comment
Open

Making whitespace the only word separator? #214

rococode opened this issue Feb 12, 2018 · 1 comment

Comments

@rococode
Copy link

Currently, it seems that diffWords treats an apostrophe as a word separator? As you can see in the above image, the single letter change in the word am (am -> an) creates a new word. But, removing 'm from i'm just crosses out the 'm rather than separating the i into a new word.

I'd like to have it so that only whitespace counts as a word separator, so that for example i'm -> i would display a crossed out i'm and a separate i. Is this possible with current options?

@rococode
Copy link
Author

Update: I was able to do this by making a new JsDiff.Diff() using src/diff/word.js as a base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants