Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/14750

Vanessae78c70253b31
diff --git a/app/src/protyle/upload/index.ts b/app/src/protyle/upload/index.ts
index 9a956c206a..ec89ab218c 100644
--- a/app/src/protyle/upload/index.ts
+++ b/app/src/protyle/upload/index.ts
@@ -107,6 +107,7 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
range.setEndAfter(range.startContainer.parentElement);
range.collapse(false);
}
+ const keys = Object.keys(response.data.succMap);
// https://github.com/siyuan-note/siyuan/issues/7624
const nodeElement = hasClosestBlock(range.startContainer);
if (nodeElement) {
@@ -114,13 +115,13 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
insertBlock = false;
} else {
const editableElement = getContenteditableElement(nodeElement);
- if (editableElement && editableElement.textContent !== "" && nodeElement.classList.contains("p")) {
+ if (editableElement && nodeElement.classList.contains("p") &&
+ (editableElement.textContent !== "" || keys.length < 2)) {
insertBlock = false;
}
}
}
let successFileText = "";
- const keys = Object.keys(response.data.succMap);
// 插入多个资源文件时按文件名自然升序排列 Use natural ascending order when inserting multiple assets https://github.com/siyuan-note/siyuan/issues/14643
keys.sort((a, b) => a.localeCompare(b, undefined, {numeric: true}));
const avAssets: IAVCellAssetValue[] = [];