-
Notifications
You must be signed in to change notification settings - Fork 505
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
Fix diffTrimmedLines
not keep whitespaces in the output
#219
Conversation
@kpdecker could you please look at this (and other my PRs)? |
d163f66
to
1b186fd
Compare
I found what seems to be an easier solution , remove the trim from the tokenize and move it to the extractCommon , something like this ?
|
@kpdecker Did you take a look at this? |
Hmmm... isn't it? After reading the docs on
From some quick experimentation, I gather that what's actually happening under the hood is option 1, but you were intuitively expecting option 3. Maybe that's reasonable but it's really nonobvious to me that your expectation will be universal, and this is a breaking change, which makes me against merging it. (Also, mightn't some people expect option 2 - i.e. that the The existing API and names IMO add confusion here that we can never escape from without a backwards compatibility break. To me, the name One way to give the people expecting behaviour 3 what they want without breaking backwards compatibility would be to have diff components returned by
Ugh, but... I notice that jsdiff already has an
So my proposed compability-preserving compromise idea has the downside of leaving the behaviours of A kinda horrible situation. I'll think about this some more and come back to it. |
I've just realised that the |
This fix a bug with use of
ignoreWhitespace
option. Before this fix you get back array with trimmed versions of the lines in the input, that not the expected behavior