singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.59k stars 837 forks source link

How to display a Delta diff? #1219

Open FaFre opened 1 year ago

FaFre commented 1 year ago

I'm struggling to display a diff I obtained from two Deltas:

jsonEncode(a.diff(b).toJson())

Produces:

[{"insert":"xda bda sdafsafdsadf  sadf sad f sadf sa df sa df sadfsadfasf"},{"delete":113}]

I tried to load those changes via Document.fromDelta as well with Document()..compose(). But in both cases there are some newline validations failing. It looks like Document.fromDelta is also only accepting inserts, but the diff produces deletes too.

Did anyone figure a way how to display diffs?

FaFre commented 1 year ago

I stumbled upon this today again. @freshtechtips do you have a hint for me?

EchoEllet commented 1 year ago

I stumbled upon this today again. @freshtechtips do you have a hint for me?

Thank you for the report

Honestly, I don't think I'm able to address this issue for now as the todos are quite big and I need quite a few months before start on this, but I will add it to the todos

CatHood0 commented 1 month ago

@FaFre does this issue still persists?