You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs says this method should create something that looks like a unified diff. When I try it I just get "[object ...]" blah blah output. Looking at the actual source code for the method, it doesn't do much, it simply tries to output some of the objects in the diff. Here's the actual source code:
/** * Take a list of patches and return a textual representation. * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of Patch objects. * @return {string} Text representation of patches. */diff_match_patch.prototype.patch_toText=function(patches){vartext=[];for(varx=0;x<patches.length;x++){text[x]=patches[x];}returntext.join('');};
So patches[x] is a javascript object, and the text.join method just creates these faulty "object" strings. I can't find any code that does anything like the comments in the source code mentions. So I guess either we need some more code or the docs should be updated and mark this method as faulty.
The text was updated successfully, but these errors were encountered:
The docs says this method should create something that looks like a unified diff. When I try it I just get "[object ...]" blah blah output. Looking at the actual source code for the method, it doesn't do much, it simply tries to output some of the objects in the diff. Here's the actual source code:
So
patches[x]
is a javascript object, and thetext.join
method just creates these faulty "object" strings. I can't find any code that does anything like the comments in the source code mentions. So I guess either we need some more code or the docs should be updated and mark this method as faulty.The text was updated successfully, but these errors were encountered: