Skip to content

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.

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

Lucas651046ab68f2
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart
index 90ed451128..4728eb7cf6 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart
@@ -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) {