This commit is contained in:
Vanessa 2023-02-01 16:25:46 +08:00
parent 5c7f3ab0bd
commit 3741775dca

View File

@ -32,10 +32,11 @@ const setBacklinkFold = (html: string, expand: boolean) => {
tempDom.innerHTML = html; tempDom.innerHTML = html;
if (tempDom.content.firstElementChild.classList.contains("li")) { if (tempDom.content.firstElementChild.classList.contains("li")) {
if (expand) { if (expand) {
const thirdLiElement = tempDom.content.querySelector(".li .li .li"); tempDom.content.querySelectorAll(".li .li .li").forEach(item => {
if (thirdLiElement) { if (item.childElementCount > 3) {
thirdLiElement.setAttribute("fold", "1"); item.setAttribute("fold", "1");
} }
});
} else { } else {
tempDom.content.firstElementChild.setAttribute("fold", "1"); tempDom.content.firstElementChild.setAttribute("fold", "1");
} }