From 834a7362934b33afb89e6071cfc31c6df5854995 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 21 Apr 2025 10:58:56 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/11276 --- app/src/protyle/preview/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.ts index 446d370f9..134529af3 100644 --- a/app/src/protyle/preview/index.ts +++ b/app/src/protyle/preview/index.ts @@ -224,6 +224,15 @@ export class Preview { copyElement.querySelectorAll("mjx-container > svg").forEach((item) => { item.setAttribute("width", (parseInt(item.getAttribute("width")) * 8) + "px"); }); + // 列表嵌套 https://github.com/siyuan-note/siyuan/issues/11276 + copyElement.querySelectorAll("ul, ol").forEach(listItem => { + Array.from(listItem.children).forEach(liItem => { + const nestedList = liItem.querySelector("ul, ol"); + if (nestedList) { + liItem.parentNode.insertBefore(nestedList, liItem.nextSibling); + } + }); + }); } else if (type === "zhihu") { this.link2online(copyElement); copyElement.querySelectorAll('[data-subtype="math"]').forEach((item: HTMLElement) => {