mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
@@ -433,6 +433,20 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/siyuan-note/siyuan/issues/14807
|
||||
if (previousLastEditElement) {
|
||||
let previousLastChild = previousLastEditElement.lastChild;
|
||||
if (previousLastChild.nodeType === 3) {
|
||||
if (!previousLastChild.textContent) {
|
||||
previousLastChild = hasPreviousSibling(previousLastChild) as ChildNode;
|
||||
}
|
||||
if (previousLastChild && previousLastChild.nodeType === 3 && previousLastChild.textContent.endsWith("\n")) {
|
||||
previousLastChild.textContent = previousLastChild.textContent.slice(0, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const scroll = protyle.contentElement.scrollTop;
|
||||
const leftNodes = range.extractContents();
|
||||
range.selectNodeContents(previousLastEditElement);
|
||||
|
||||
Reference in New Issue
Block a user