From 57e3a2ce68ccb02cf354d9cb9eddf2b89f110139 Mon Sep 17 00:00:00 2001 From: q200892907 <200892907@qq.com> Date: Fri, 15 Mar 2024 14:38:27 +0800 Subject: [PATCH] fix: apply formatting to pasted text only when the block is a paragraph (#4906) --- .../copy_and_paste/editor_state_paste_node_extension.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_paste_node_extension.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_paste_node_extension.dart index 1fc92c2d0f..34c6c8fe06 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_paste_node_extension.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_paste_node_extension.dart @@ -13,8 +13,8 @@ extension PasteNodes on EditorState { } final transaction = this.transaction; final insertedDelta = insertedNode.delta; - // if the node is empty, replace it with the inserted node. - if (delta.isEmpty) { + // if the node is empty and its type is paragprah, replace it with the inserted node. + if (delta.isEmpty && node.type == ParagraphBlockKeys.type) { transaction.insertNode( selection.end.path.next, insertedNode,