Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17759

Vanessad7350f3e4f9c
diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.ts
index f91e2f84e5..c9675ecd94 100644
--- a/app/src/protyle/preview/index.ts
+++ b/app/src/protyle/preview/index.ts
@@ -228,7 +228,10 @@ export class Preview {
item.setAttribute("width", (parseInt(item.getAttribute("width")) * 8) + "px");
});
// 列表嵌套 https://github.com/siyuan-note/siyuan/issues/11276
- copyElement.querySelectorAll("ul, ol").forEach(listItem => {
+ copyElement.querySelectorAll("ul, ol").forEach((listItem: HTMLOListElement) => {
+ if (typeof listItem.start === "number") {
+ listItem.style.paddingLeft = listItem.start.toString().length + 0.2 + "em";
+ }
Array.from(listItem.children).forEach(liItem => {
const nestedList = liItem.querySelector("ul, ol");
if (nestedList) {