🎨 Support path with spaces when using the link to set the header image Fix https://github.com/siyuan-note/siyuan/issues/8113

This commit is contained in:
Liang Ding 2023-04-27 10:45:38 +08:00
parent 72c7a231c2
commit 1b96187ff2
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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", {