diff-match-patch icon indicating copy to clipboard operation
diff-match-patch copied to clipboard

patch_obj.toString blows up with emojis

Open d4rkr00t opened this issue 6 years ago • 0 comments

encodeURI blows up for some patch_obj: https://github.com/google/diff-match-patch/blob/a6367d7866833ac037fbdefcdbcbee4def86e326/javascript/diff_match_patch_uncompressed.js#L2186

Example:

let diff_match_patch = require("diff-match-patch");

let text1 = "🅱";
let text2 = "🅰";

let diff = new diff_match_patch();
console.log(diff.patch_toText(diff.patch_make(text1, text2)));

d4rkr00t avatar Jun 20 '19 03:06 d4rkr00t