From 1b96187ff20ee82659cdad4672e3a5902fb24943 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 27 Apr 2023 10:45:38 +0800 Subject: [PATCH] :art: Support path with spaces when using the link to set the header image Fix https://github.com/siyuan-note/siyuan/issues/8113 --- app/src/protyle/header/Background.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index 4ed8e26e8..94e4d8daa 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -3,13 +3,7 @@ import {getRandom, isMobile} from "../../util/functions"; import {hideElements} from "../ui/hideElements"; import {uploadFiles} from "../upload"; import {fetchPost} from "../../util/fetch"; -import { - getRandomEmoji, - openEmojiPanel, - unicode2Emoji, - updateFileTreeEmoji, - updateOutlineEmoji -} from "../../emoji"; +import {getRandomEmoji, openEmojiPanel, unicode2Emoji, updateFileTreeEmoji, updateOutlineEmoji} from "../../emoji"; import {upDownHint} from "../../util/upDownHint"; /// #if !MOBILE import {openGlobalSearch} from "../../search/util"; @@ -322,7 +316,7 @@ export class Background { dialog.destroy(); }); btnsElement[1].addEventListener("click", () => { - const style = `background-image:url(${dialog.element.querySelector("input").value});`; + const style = `background-image:url("${dialog.element.querySelector("input").value}");`; this.ial["title-img"] = style; this.render(this.ial, protyle.block.rootID); fetchPost("/api/attr/setBlockAttrs", {