mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
f8f60be8a6
commit
94812ef11c
2 changed files with 3 additions and 4 deletions
|
|
@ -178,8 +178,8 @@ const getActionMenu = (element: Element, next: boolean) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return actionMenuElement;
|
return actionMenuElement;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bindMenuKeydown = (event: KeyboardEvent) => {
|
export const bindMenuKeydown = (event: KeyboardEvent) => {
|
||||||
if (window.siyuan.menus.menu.element.classList.contains("fn__none") || event.altKey || event.shiftKey || isCtrl(event)) {
|
if (window.siyuan.menus.menu.element.classList.contains("fn__none") || event.altKey || event.shiftKey || isCtrl(event)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,11 @@ export class Link extends ToolbarItem {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rangeString = range.toString().trim();
|
const rangeString = range.toString().trim().replace(Constants.ZWSP, "");
|
||||||
let dataHref = "";
|
let dataHref = "";
|
||||||
let dataText = "";
|
let dataText = "";
|
||||||
try {
|
try {
|
||||||
const clipText = await readText();
|
const clipText = await readText();
|
||||||
|
|
||||||
// 选中链接时需忽略剪切板内容 https://ld246.com/article/1643035329737
|
// 选中链接时需忽略剪切板内容 https://ld246.com/article/1643035329737
|
||||||
if (protyle.lute.IsValidLinkDest(rangeString)) {
|
if (protyle.lute.IsValidLinkDest(rangeString)) {
|
||||||
dataHref = rangeString;
|
dataHref = rangeString;
|
||||||
|
|
@ -62,7 +61,7 @@ export const removeLink = (linkElement: HTMLElement, range: Range) => {
|
||||||
const types = linkElement.getAttribute("data-type").split(" ");
|
const types = linkElement.getAttribute("data-type").split(" ");
|
||||||
if (types.length === 1) {
|
if (types.length === 1) {
|
||||||
const linkParentElement = linkElement.parentElement;
|
const linkParentElement = linkElement.parentElement;
|
||||||
linkElement.outerHTML = linkElement.innerHTML + "<wbr>";
|
linkElement.outerHTML = linkElement.innerHTML.replace(Constants.ZWSP, "") + "<wbr>";
|
||||||
focusByWbr(linkParentElement, range);
|
focusByWbr(linkParentElement, range);
|
||||||
} else {
|
} else {
|
||||||
types.find((itemType, index) => {
|
types.find((itemType, index) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue