From 1b0bfa2f979cb8cda4143a923fa585e56a8d5ec2 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 17 May 2023 22:41:53 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/8290 --- app/src/menus/protyle.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index f96a121ed..b1fd81867 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -736,7 +736,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText label: `
`, bind(element) { const inputElement = element.querySelector("textarea"); - inputElement.value = linkAddress || ""; + inputElement.value = Lute.UnEscapeHTMLStr(linkAddress) || ""; inputElement.addEventListener("keydown", (event) => { if ((event.key === "Enter" || event.key === "Escape") && !event.isComposing) { event.preventDefault(); @@ -884,7 +884,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText } else { linkElement.removeAttribute("data-title"); } - linkElement.setAttribute("data-href", textElements[0].value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "")); + linkElement.setAttribute("data-href", Lute.EscapeHTMLStr(textElements[0].value.replace(/\n|\r\n|\r|\u2028|\u2029/g, ""))); if (linkElement.textContent === "" || linkElement.textContent === Constants.ZWSP) { removeLink(linkElement, protyle.toolbar.range); } else {