Vanessa 2025-12-29 22:08:07 +08:00
parent d6730613df
commit cde0840bf7

View file

@ -511,6 +511,14 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
// 图片前删除到上一个文字块时,图片前有 zwsp
previousLastElement.outerHTML = protyle.lute.SpinBlockDOM(previousLastElement.outerHTML);
mathRender(getPreviousBlock(removeElement) as HTMLElement);
const removeParentElement = removeElement.parentElement;
// https://github.com/siyuan-note/siyuan/issues/12327
if (removeParentElement.classList.contains("li") && removeParentElement.childElementCount === 4 &&
removeParentElement.getAttribute("fold") === "1") {
const foldOperations = setFold(protyle, removeParentElement, true, false, false, true);
doOperations.push(...foldOperations.doOperations);
undoOperations.splice(0, 0, ...foldOperations.undoOperations);
}
removeElement.remove();
// extractContents 内容过多时需要进行滚动条重置,否则位置会错位
protyle.contentElement.scrollTop = scroll;