If comparing value's string size exceed the more than textdiff limit, the diff result will spill out patch syntax.
Reproducible Steps
- Go to live demo (https://benjamine.github.io/jsondiffpatch/demo/index.html)
- Paste the following json string
{
"hello": "X one two three four five six seven eight nine ten eleven (ABC)"
}
- Change first few characters
- You will see wrong comparison result such as
{
"hello": [
"@@ -1,5 +1,5 @@\n-X\n+Y\n one\n",
0,
2
]
}
Please note that the live demo has default textDiff limit which is 60.
Note
To avoid this, I simply set textDiff option very large so that it wouldn't spill out.
textDiff: {
minLength:1000
},