Skip to content

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

:art: `file://` 协议兼容 Window 平台使用 `/` 作为目录分割线 Fix https://github.com/siyuan-note/siyuan/issues/5681

Liang Dingdcd4e3a3829e
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts
index 04de8055c0..70f76f6e97 100644
--- a/app/src/editor/util.ts
+++ b/app/src/editor/util.ts
@@ -18,11 +18,7 @@ import {shell} from "electron";
import {pushBack} from "../util/backForward";
import {Asset} from "../asset";
import {Layout} from "../layout";
-import {
- hasClosestBlock,
- hasClosestByAttribute,
- hasClosestByClassName,
-} from "../protyle/util/hasClosest";
+import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName,} from "../protyle/util/hasClosest";
import {getPreviousHeading} from "../protyle/wysiwyg/getBlock";
import {lockFile, setTitle} from "../dialog/processSystem";
import {zoomOut} from "../menus/protyle";
@@ -451,7 +447,13 @@ export const openBy = (url: string, type: "folder" | "app") => {
});
return;
} else {
- address = url.replace("file://", "");
+ address = url.replace("file:///", "");
+ address = address.replace("file://", "");
+ address = address.replace("file://\\", "");
+ if ("windows" === window.siyuan.config.system.os) {
+ // `file://` 协议兼容 Window 平台使用 `/` 作为目录分割线 https://github.com/siyuan-note/siyuan/issues/5681
+ address = address.replace("/", "\\");
+ }
}
if (type === "app") {