Hi I am trying to get the gifference between strings using "google-diff-match-patch",
but I cant get it return the changed text
here is my function:
ThanksCode:function getDiffs(a, b) { a = a.replace(/(<([^>]+)>)/ig,""); b = b.replace(/(<([^>]+)>)/ig,""); var dmp = new diff_match_patch(); var d = dmp.diff_main(a, b); dmp.cleanupSemantic(d); return dmp.diff_prettyHtml(d); } alert( getDiffs("abcdef", "ab12ef") );
Vinny


Reply With Quote
Bookmarks