Vanessa 2024-12-18 18:03:08 +08:00
parent 6cfa8e6cbe
commit 1d4380bb75

View file

@ -853,8 +853,19 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
let nextSibling = hasNextSibling(range.startContainer) as Element;
if (nextSibling) {
if (nextSibling.nodeType === 3 && nextSibling.textContent === Constants.ZWSP) {
if (!nextSibling.nextSibling) {
// https://github.com/siyuan-note/siyuan/issues/13524
const nextBlockElement = getNextBlock(nodeElement)
if (nextBlockElement) {
removeBlock(protyle, nextBlockElement, range, "remove");
}
event.stopPropagation();
event.preventDefault();
return;
}
nextSibling = nextSibling.nextSibling as Element;
}
if (nextSibling.nodeType === 1 && nextSibling.classList.contains("img")) {
// 光标需在图片前 https://github.com/siyuan-note/siyuan/issues/12452
const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range);