mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
6e0da992af
commit
ca856a8770
1 changed files with 15 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ import {
|
||||||
getLastBlock,
|
getLastBlock,
|
||||||
getNextBlock,
|
getNextBlock,
|
||||||
getPreviousBlock,
|
getPreviousBlock,
|
||||||
getTopAloneElement,
|
getTopAloneElement, hasNextSibling,
|
||||||
hasPreviousSibling,
|
hasPreviousSibling,
|
||||||
isNotEditBlock,
|
isNotEditBlock,
|
||||||
} from "./getBlock";
|
} from "./getBlock";
|
||||||
|
|
@ -806,6 +806,20 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
|
} else
|
||||||
|
// 图片前 Delete 无效 https://github.com/siyuan-note/siyuan/issues/11209
|
||||||
|
let nextSibling = hasNextSibling(range.startContainer) as Element;
|
||||||
|
if (nextSibling) {
|
||||||
|
if (nextSibling.nodeType === 3 && nextSibling.textContent === Constants.ZWSP) {
|
||||||
|
nextSibling = nextSibling.nextSibling as Element;
|
||||||
|
}
|
||||||
|
if (nextSibling.nodeType === 1 && nextSibling.classList.contains("img")) {
|
||||||
|
removeImage(nextSibling as Element, nodeElement, range, protyle);
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const currentNode = range.startContainer.childNodes[range.startOffset - 1] as HTMLElement;
|
const currentNode = range.startContainer.childNodes[range.startOffset - 1] as HTMLElement;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue