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

Word-level diff behavior #85

Closed lujuste closed 1 year ago

lujuste commented 2 years ago

diff doesn't make a difference at the word level but at the character level, and this ends up generating some semantic problems and causing bugs, would there be any way to change the word itself and not the letter?

For example using this logic:

https://codepen.io/percipient24/pen/eEBOjG

It is possible to notice that when there is an equal character, this character is ignored as a change. Many of the words get confused whenever there is an equal character in the middle of the word that I want to remove entirely.

I would like to know if it is possible to just change the word and mark the word and not the character level. Which way could I go?

In the example below I don't want it like this:

wrong png

but I would like it to be like this:

right

Can someone please help me find a way to replace words and not letters? I love quill js and I really need to implement this functionality

lujuste commented 2 years ago

Please guys anyone can be save me?

luin commented 1 year ago

Hey @lujuste 👋 , Sorry for the delay! Now word level diffing is the default behavior.

lujuste commented 1 year ago

@luin tks for reply! great job! I will test! Thank you very much