Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/5423

Vanessab5c80bfa58be
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 44f730470e..f8531d7ab0 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -107,7 +107,7 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (!protyle.wysiwyg.element.querySelector(".protyle-wysiwyg--select") && !protyle.scroll.keepLazyLoad && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT) {
let removeElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
const removeElements = [];
- while (protyle.wysiwyg.element.childElementCount > 2) {
+ while (protyle.wysiwyg.element.childElementCount > 2 && removeElements && !protyle.wysiwyg.element.lastElementChild.isSameNode(removeElement)) {
if (protyle.contentElement.scrollHeight - removeElement.offsetTop > REMOVED_OVER_HEIGHT) {
removeElements.push(removeElement);
} else {