mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
5c7f3ab0bd
commit
3741775dca
1 changed files with 5 additions and 4 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue