An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/14894
Vanessa8ba7a703ed37
diff --git a/app/src/asset/index.ts b/app/src/asset/index.tsindex d0cc99e5e8..0388f3dd49 100644--- a/app/src/asset/index.ts+++ b/app/src/asset/index.ts@@ -86,7 +86,7 @@ export class Asset extends Model {}private render() {- const type = this.path.substr(this.path.lastIndexOf(".")).toLowerCase();+ const type = this.path.substr(this.path.lastIndexOf(".")).toLowerCase().split("?")[0];if (Constants.SIYUAN_ASSETS_IMAGE.includes(type)) {this.element.innerHTML = `<div class="asset"><img src="${this.path.startsWith("file") ? this.path : document.getElementById("baseURL").getAttribute("href") + "/" + this.path}"></div>`;} else if (Constants.SIYUAN_ASSETS_AUDIO.includes(type)) {diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex f1c61f0d83..9f9d0c5de1 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -74,7 +74,7 @@ export const openFileById = async (options: {};export const openAsset = (app: App, assetPath: string, page: number | string, position?: string) => {- const suffix = pathPosix().extname(assetPath.split("?page")[0]);+ const suffix = pathPosix().extname(assetPath).split("?")[0];if (!Constants.SIYUAN_ASSETS_EXTS.includes(suffix)) {return;}@@ -421,7 +421,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModconst newTab = (options: IOpenFileOptions) => {let tab: Tab;if (options.assetPath) {- const suffix = pathPosix().extname(options.assetPath.split("?page")[0]);+ const suffix = pathPosix().extname(options.assetPath).split("?")[0];if (Constants.SIYUAN_ASSETS_EXTS.includes(suffix)) {let icon = "iconPDF";if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.tsindex 115d436f08..255a67aa30 100644--- a/app/src/menus/commonMenuItem.ts+++ b/app/src/menus/commonMenuItem.ts@@ -727,7 +727,7 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat});/// #elseif (isLocalPath(src)) {- if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname(src)) &&+ if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname(src).split("?")[0]) &&(!src.endsWith(".pdf") ||(src.endsWith(".pdf") && !src.startsWith("file://")))) {diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.tsindex b9a0a76560..2f1d5f2e91 100644--- a/app/src/protyle/preview/index.ts+++ b/app/src/protyle/preview/index.ts@@ -99,7 +99,7 @@ export class Preview {openBy(linkAddress, "folder");} else if (event.shiftKey) {openBy(linkAddress, "app");- } else if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname((linkAddress.split("?page")[0])))) {+ } else if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname((linkAddress).split("?")[0]))) {openAsset(protyle.app, linkAddress.split("?page")[0], parseInt(getSearch("page", linkAddress)));}/// #endifdiff --git a/app/src/window/openNewWindow.ts b/app/src/window/openNewWindow.tsindex 2ed26b79f1..a4b1517e20 100644--- a/app/src/window/openNewWindow.ts+++ b/app/src/window/openNewWindow.ts@@ -74,7 +74,7 @@ export const openNewWindowById = async (id: string | string[], options: windowOpexport const openAssetNewWindow = (assetPath: string, options: windowOptions = {}) => {/// #if !BROWSER- const suffix = pathPosix().extname(assetPath.split("?page")[0]);+ const suffix = pathPosix().extname(assetPath).split("?")[0];if (Constants.SIYUAN_ASSETS_EXTS.includes(suffix)) {let docIcon = "iconPDF";if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {