Skip to content

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

:art: Use natural ascending order when inserting multiple assets https://github.com/siyuan-note/siyuan/issues/14643

Daniel6bf9f0429d8a
diff --git a/app/src/protyle/upload/index.ts b/app/src/protyle/upload/index.ts
index 366e970470..e882fddebc 100644
--- a/app/src/protyle/upload/index.ts
+++ b/app/src/protyle/upload/index.ts
@@ -121,6 +121,8 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
}
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[] = [];
let hasImage = false;
keys.forEach((key, index) => {