jsdiff
jsdiff copied to clipboard
Making whitespace the only word separator?

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?
Update: I was able to do this by making a new JsDiff.Diff() using src/diff/word.js as a base.