fix: unable to paste iframe in editor (#7525)

This commit is contained in:
Lucas 2025-03-13 13:58:24 +08:00 committed by GitHub
parent 9bd13ac29e
commit 651046ab68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,8 +32,11 @@ extension PasteFromPlainText on EditorState {
await deleteSelectionIfNeeded();
/// try to parse the plain text as markdown
final nodes = customMarkdownToDocument(plainText).root.children;
if (nodes.isEmpty) {
/// if the markdown parser failed, fallback to the plain text parser
await pastePlainText(plainText);
return;
}
if (nodes.length == 1) {