slab / delta

Simple and expressive JSON format for describing rich-text content and their changes
https://quilljs.com/docs/delta
BSD 3-Clause "New" or "Revised" License
914 stars 130 forks source link

diff() and Unicode surrogate pairs #40

Closed Calyhre closed 5 years ago

Calyhre commented 5 years ago

Since quill-delta has moved to fast-diff@1.2.0, who now is unicode-safe (https://github.com/jhchen/fast-diff/pull/4), using .diff() on document that has a retain leading to a unicode surrogate pair being broke, there is a Maximum call stack size exceeded error.

Here is in 4.0.1 without error: https://repl.it/repls/PungentColorfulScandisk And in 4.1.0 with the error: https://repl.it/repls/FrailLimitedCoolingfan

My guess is that as quill-delta is not unicode-safe, any used dependency shouldn't be neither

jhchen commented 5 years ago

This seems to be a bug with fast-diff. Can you post an issue there?

Calyhre commented 5 years ago

Will do, but that would still be an issue to have a unicode aware dependency and not quill-delta no?

jhchen commented 5 years ago

quill-delta's unicode awareness comes from fast-diff