Skip to content

Commit

Permalink
fix: 带有空格的链接剪切粘贴后会变成 %20
Browse files Browse the repository at this point in the history
fix #13909
  • Loading branch information
TCOTC committed Feb 1, 2025
1 parent a45ac25 commit 8c363fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/menus/protyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", "<wbr>");
linkElement.remove();
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, nodeElement.outerHTML, html);
focusByWbr(nodeElement, protyle.toolbar.range);
Expand Down

0 comments on commit 8c363fe

Please sign in to comment.