Improves the new logic of pasting HTML contents into the Editor

pull/1578/head
Ellet 1 year ago
parent 6c5bd5d277
commit 67adb199ba
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 4
      CHANGELOG.md
  2. 12
      lib/src/widgets/raw_editor/raw_editor_state.dart
  3. 2
      version.dart

@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
## 9.0.0-dev-9
* Improves the new logic of pasting HTML contents into the Editor
* Update `README.md` and the doc
## 9.0.0-dev-8
* Better support for pasting HTML contents from external websites to the editor
* The experimental support of converting the HTML from `quill_html_converter` is now built-in in the `flutter_quill` and removed from there (Breaking change for `quill_html_converter`)

@ -237,17 +237,7 @@ class QuillRawEditorState extends EditorState
deltaFromCliboard = QuillController.fromHtml(html);
}
if (deltaFromCliboard != null) {
// final index = selection.baseOffset;
// final length = selection.extentOffset - index;
final list = controller.document.toDelta().toList()
..insertAll(controller.document.toDelta().toList().length - 1,
deltaFromCliboard.toList());
final delta = controller.document.toDelta();
for (final operation in list) {
delta.push(operation);
}
final delta = controller.document.toDelta().compose(deltaFromCliboard);
controller
..updateDocument(

@ -1 +1 @@
const version = '9.0.0-dev-8';
const version = '9.0.0-dev-9';

Loading…
Cancel
Save