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

diffWords treats \n at the end as significant whitespace #70

Closed
OleMchls opened this issue Aug 17, 2015 · 2 comments
Closed

diffWords treats \n at the end as significant whitespace #70

OleMchls opened this issue Aug 17, 2015 · 2 comments
Milestone

Comments

@OleMchls
Copy link

we have the following behavior:

coffee> diff = require 'diff'

# works as expected
coffee> diff.diffWords("hase igel fuchs", "hase igel fuchs")
[ { value: 'hase igel fuchs' } ]

# newline at righthand results in a change
coffee> diff.diffWords("hase igel fuchs", "hase igel fuchs\n")
[ { count: 5, value: 'hase igel fuchs' },
  { count: 1, added: true, removed: undefined, value: '\n' } ]

# newline at lefthand results in a change
coffee> diff.diffWords("hase igel fuchs\n", "hase igel fuchs")
[ { count: 5, value: 'hase igel fuchs' },
  { count: 1, added: undefined, removed: true, value: '\n' } ]

# newline in the middle words also as expected
coffee> diff.diffWords("hase igel fuchs", "hase igel\nfuchs")
[ { value: 'hase igel\nfuchs' } ]

when we read the documentation right, every whitespace should be ignored when using diffWords.

Any thoughts on that?

/cc @Partyschaum

@wfalkwallace
Copy link

see #68.

@kpdecker kpdecker added this to the 2.1.0 milestone Aug 26, 2015
@kpdecker
Copy link
Owner

Released in 2.1.0

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

No branches or pull requests

3 participants