-
Notifications
You must be signed in to change notification settings - Fork 510
Newlines are not properly compared when using diffWords #140
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
Comments
Yeah, this certainly looks like a bug to me:
The fourth change object - I'll dig into it tomorrow and see if I can make sense of what's causing this (and whether it has implications beyond |
I'm dumb - this isn't a bug, but rather an intentional feature of
There might be better ways of showing the result when we've "ignored" a whitespace difference (see my prior commentary at #219 (comment)), but the current output is intentional.
|
Passing the following 2 strings (in order) into the diffWords function results in some strange results. Some newlines that are added in the second string come back in the array with no "added" indication. This was producing some very strange behavior for our users where newlines would appear 1 word early in the string when we would try to discard all added strings (rather than not appearing at all which is how I would expect it to behave).
Please excuse the bizarre strings - you do what you have to do to stay sane when trying to fix bugs :)
Lastly when testing this please replace the ↵ characters with actual new lines. Probably obvious, but clarifying can't hurt too much.
The text was updated successfully, but these errors were encountered: