Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
feat: use patch nodes
Vincent Chan40c3f07be431
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/service/internal_key_event_handlers/copy_paste_handler.dart b/frontend/app_flowy/packages/flowy_editor/lib/service/internal_key_event_handlers/copy_paste_handler.dartindex dd20f39ca9..01149af9ca 100644--- a/frontend/app_flowy/packages/flowy_editor/lib/service/internal_key_event_handlers/copy_paste_handler.dart+++ b/frontend/app_flowy/packages/flowy_editor/lib/service/internal_key_event_handlers/copy_paste_handler.dart@@ -17,10 +17,14 @@ _pasteHTML(EditorState editorState, String html) {return;}- final tb = TransactionBuilder(editorState);- for (final node in nodes) {- tb.insertNode(selection.end.path, node);+ final path = [...selection.end.path];+ if (path.isEmpty) {+ return;}+ path[path.length - 1]++;++ final tb = TransactionBuilder(editorState);+ tb.insertNodes(path, nodes);tb.commit();}