🐛 链接菜单中移除锚文本后无法撤销

This commit is contained in:
Vanessa 2022-07-16 17:35:44 +08:00
parent bc0f4819dd
commit 658c37646d

View file

@ -627,8 +627,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
inputElement.value = linkElement.textContent.replace(Constants.ZWSP, "");
inputElement.addEventListener("change", () => {
if (!inputElement.value) {
protyle.toolbar.setInlineMark(protyle, "link", "remove");
window.siyuan.menus.menu.remove();
linkElement.remove();
}
updateTransaction(protyle, id, nodeElement.outerHTML, html);
html = nodeElement.outerHTML;