Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: pasteURLAutoConvert

Vanessab9bd62d8eec9
diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts
index 3aba6ac89c..f2da044b44 100644
--- a/app/src/protyle/util/paste.ts
+++ b/app/src/protyle/util/paste.ts
@@ -24,7 +24,7 @@ const pasteAsLink = (text: string, protyle: IProtyle): boolean => {
return false;
}
const trimmed = text.trim();
- if (!trimmed || trimmed.includes("\n")) {
+ if (!trimmed || trimmed.includes("\n") || trimmed.includes(" ")) {
// TODO 暂不支持多行文本
return false;
}
@@ -445,9 +445,6 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
return;
}
}
- if (pasteAsLink(tempElement.textContent, protyle)) {
- return;
- }
let isBlock = false;
tempElement.querySelectorAll("[data-node-id]").forEach((e) => {
const newId = Lute.NewNodeID();