From d982fd1ddec5a7a7914bf00cc749960223d29e8e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 18 Aug 2022 20:13:03 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/2892 --- app/src/protyle/toolbar/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/util.ts b/app/src/protyle/toolbar/util.ts index e84530e08..b051e15ee 100644 --- a/app/src/protyle/toolbar/util.ts +++ b/app/src/protyle/toolbar/util.ts @@ -1,7 +1,7 @@ import {fetchPost} from "../../util/fetch"; export const previewTemplate = (pathString: string, element: Element) => { - fetchPost("/api/file/getFile", {path: pathString.replace(window.siyuan.config.system.dataDir, "")}, (response) => { + fetchPost("/api/file/getFile", {path: pathString.replace(window.siyuan.config.system.dataDir.substring(0, window.siyuan.config.system.dataDir.length - 4), "")}, (response) => { element.innerHTML = response.data; }) }