From f343302f28b4681af0c35b4600be167b161bfabe Mon Sep 17 00:00:00 2001 From: "Kilu.He" <108015703+qinluhe@users.noreply.github.com> Date: Fri, 7 Mar 2025 10:58:21 +0800 Subject: [PATCH] fix: this issue paste from other sources (#61) --- src/components/editor/plugins/withPasted.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/editor/plugins/withPasted.ts b/src/components/editor/plugins/withPasted.ts index 7c0d6035..543515bd 100644 --- a/src/components/editor/plugins/withPasted.ts +++ b/src/components/editor/plugins/withPasted.ts @@ -89,7 +89,12 @@ export const withPasted = (editor: ReactEditor) => { if(html) { return insertHtmlData(editor, data); } else { - const fragment = lines.map((line) => ({ type: BlockType.Paragraph, children: [{ text: line }] })); + const fragment = lines.map((line) => ({ + type: BlockType.Paragraph, children: [{ + type: 'text', + children: [{ text: line }], + }], + })); insertFragment(editor, fragment); return true;