diff --git a/flutter_quill_extensions/pubspec.yaml b/flutter_quill_extensions/pubspec.yaml index ee22fe6c..9ee322b1 100644 --- a/flutter_quill_extensions/pubspec.yaml +++ b/flutter_quill_extensions/pubspec.yaml @@ -35,15 +35,15 @@ dependencies: universal_html: ^2.2.4 cross_file: ^0.3.3+6 - flutter_quill: ^9.0.0-dev + flutter_quill: ^9.2.1 photo_view: ^0.14.0 # Plugins video_player: ^2.8.1 youtube_player_flutter: ^9.0.0-beta.0 url_launcher: ^6.2.1 - super_clipboard: ^0.8.1 - gal: ^2.1.3 + super_clipboard: ^0.8.2+1 + gal: ^2.2.0 gal_linux: ^0.0.1 image_picker: ^1.0.4 diff --git a/lib/src/widgets/raw_editor/raw_editor_state.dart b/lib/src/widgets/raw_editor/raw_editor_state.dart index 4b006b6f..c620c11f 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state.dart @@ -19,6 +19,7 @@ import 'package:flutter/services.dart' TextInputControl; import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart' show KeyboardVisibilityController; +import 'package:html/parser.dart' as html_parser; import 'package:super_clipboard/super_clipboard.dart'; import '../../../quill_delta.dart'; @@ -217,7 +218,9 @@ class QuillRawEditorState extends EditorState if (html == null) { return; } - final deltaFromClipboard = Document.fromHtml(html); + final htmlBody = html_parser.parse(html).body?.outerHtml; + final deltaFromClipboard = Document.fromHtml(htmlBody ?? html); + var newDelta = Delta(); newDelta = newDelta.compose(deltaFromClipboard); if (!controller.document.isEmpty()) { diff --git a/pubspec.yaml b/pubspec.yaml index aefaa438..2fdf3eb9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,6 +49,7 @@ dependencies: quiver: ^3.2.1 equatable: ^2.0.5 meta: ^1.9.1 + html: ^0.15.4 flutter_colorpicker: ^1.0.3 @@ -61,7 +62,7 @@ dependencies: url_launcher: ^6.1.14 flutter_keyboard_visibility: ^6.0.0 device_info_plus: ^9.1.0 - super_clipboard: ^0.8.1 + super_clipboard: ^0.8.2+1 dev_dependencies: flutter_lints: ^3.0.1