From 3741775dca5d15c1a4e9dbbcc57eead045aee4d9 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 1 Feb 2023 16:25:46 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7214 --- app/src/protyle/wysiwyg/renderBacklink.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/wysiwyg/renderBacklink.ts b/app/src/protyle/wysiwyg/renderBacklink.ts index a79171f52..ae90943ac 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"); }