mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-22 16:26:09 +01:00
fix: 带有空格的链接剪切粘贴后会变成 %20 (#13991)
fix https://github.com/siyuan-note/siyuan/issues/13909
This commit is contained in:
parent
45dd4cb000
commit
6dff9b4688
1 changed files with 4 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue