Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/7214

Vanessa3741775dca5d
diff --git a/app/src/protyle/wysiwyg/renderBacklink.ts b/app/src/protyle/wysiwyg/renderBacklink.ts
index a79171f52e..ae90943acb 100644
--- a/app/src/protyle/wysiwyg/renderBacklink.ts
+++ b/app/src/protyle/wysiwyg/renderBacklink.ts
@@ -32,10 +32,11 @@ const setBacklinkFold = (html: string, expand: boolean) => {
tempDom.innerHTML = html;
if (tempDom.content.firstElementChild.classList.contains("li")) {
if (expand) {
- const thirdLiElement = tempDom.content.querySelector(".li .li .li");
- if (thirdLiElement) {
- thirdLiElement.setAttribute("fold", "1");
- }
+ tempDom.content.querySelectorAll(".li .li .li").forEach(item => {
+ if (item.childElementCount > 3) {
+ item.setAttribute("fold", "1");
+ }
+ });
} else {
tempDom.content.firstElementChild.setAttribute("fold", "1");
}