mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
This commit is contained in:
parent
aeda90cd14
commit
a9132e9af4
1 changed files with 14 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue