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

createPatch -> applyPatch failed. #57

Closed
mog422 opened this issue May 5, 2015 · 2 comments
Closed

createPatch -> applyPatch failed. #57

mog422 opened this issue May 5, 2015 · 2 comments

Comments

@mog422
Copy link

mog422 commented May 5, 2015

var diff = require('./diff');

var oldtext = 'AAAAAAAAAAAAAAAA\n\n';
var newtext = 'AAAAAAAAAAAAAAAA\nBBBBBB' + String.fromCharCode(8232) + '\nCCCCCCCCCCCCCCCCCC\n\n';


var diffed = diff.createPatch('test', oldtext, newtext);
console.log(diff.applyPatch(oldtext, diffed) !== newtext ? 'failed' : 'success');

This code result must be success.
But It's failed.

@kpdecker
Copy link
Owner

kpdecker commented May 6, 2015

Thanks for filing the issue. It looks like we are not handling the various unicode line control characters properly. I've updated it so only ASCII new lines are considered for patch creation.

@kpdecker
Copy link
Owner

kpdecker commented May 6, 2015

Released in 1.4.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

2 participants