fix: preserve list context and nested CSS decoration behavior

This commit is contained in:
2026-11-05 09:49:52 +08:00
parent d0f95d277a
commit 77ee046463
10 changed files with 284 additions and 79 deletions
+1
View File
@@ -425,6 +425,7 @@ class DocumentStyleEditorDialog(QDialog):
if hasattr(self.parent(), '_configure_web_settings'):
self.parent()._configure_web_settings(self.actual_preview.settings())
sample = '# 标题 1 中的 **加粗** 与 [链接](#预览)\n\n## 标题 2\n\n### 标题 3\n\n#### 标题 4\n\n##### 标题 5\n\n###### 标题 6\n\n正文段落:中文与 English,**加粗**、*强调*、~~删除线~~、`inline code`。\n\n第二段文字,用于观察段间距。\n\n> 引用段落中的 **重点**。\n\n- 无序列表\n - 第二级列表\n\n1. 有序列表\n2. 第二项\n\n- [ ] 任务列表\n\n```text\n代码块 code block\n第二行\n```\n\n| 表头 | Heading |\n|---|---|\n| 单元格 | Cell |'
sample += '\n| 第二行 | Alternating row |\n| 第三行 | Third row |'
parent = self.parent()
root = getattr(parent, 'project_root', Path.cwd())
content = MarkdownRenderer(root).render_source(sample, root / '__style_preview__.md',