This commit is contained in:
Vanessa 2022-12-01 00:52:39 +08:00
parent f8f60be8a6
commit 94812ef11c
2 changed files with 3 additions and 4 deletions

View file

@ -178,8 +178,8 @@ const getActionMenu = (element: Element, next: boolean) => {
}
}
return actionMenuElement;
};
export const bindMenuKeydown = (event: KeyboardEvent) => {
if (window.siyuan.menus.menu.element.classList.contains("fn__none") || event.altKey || event.shiftKey || isCtrl(event)) {
return false;

View file

@ -26,12 +26,11 @@ export class Link extends ToolbarItem {
return;
}
const rangeString = range.toString().trim();
const rangeString = range.toString().trim().replace(Constants.ZWSP, "");
let dataHref = "";
let dataText = "";
try {
const clipText = await readText();
// 选中链接时需忽略剪切板内容 https://ld246.com/article/1643035329737
if (protyle.lute.IsValidLinkDest(rangeString)) {
dataHref = rangeString;
@ -62,7 +61,7 @@ export const removeLink = (linkElement: HTMLElement, range: Range) => {
const types = linkElement.getAttribute("data-type").split(" ");
if (types.length === 1) {
const linkParentElement = linkElement.parentElement;
linkElement.outerHTML = linkElement.innerHTML + "<wbr>";
linkElement.outerHTML = linkElement.innerHTML.replace(Constants.ZWSP, "") + "<wbr>";
focusByWbr(linkParentElement, range);
} else {
types.find((itemType, index) => {