fix: this issue paste from other sources (#61)

This commit is contained in:
Kilu.He
2025-03-07 10:58:21 +08:00
committed by GitHub
parent a3eed75fb3
commit f343302f28

View File

@@ -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;