From 8c363fef8ef2d969205bf0928c296a0d35a2edd9 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Sat, 1 Feb 2025 16:23:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B8=A6=E6=9C=89=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5=E5=89=AA=E5=88=87=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E5=8F=98=E6=88=90=20`%20`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/siyuan-note/siyuan/issues/13909 --- app/src/menus/protyle.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 290ac84d488..7c8187d2112 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -1518,10 +1518,11 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText icon: "iconCut", label: window.siyuan.languages.cut, click() { - writeText(protyle.lute.BlockDOM2StdMd(linkElement.outerHTML)); + const range = document.createRange(); + range.selectNode(linkElement); + focusByRange(range); + document.execCommand("cut"); - linkElement.insertAdjacentHTML("afterend", ""); - linkElement.remove(); nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, id, nodeElement.outerHTML, html); focusByWbr(nodeElement, protyle.toolbar.range);