diff --git a/frontend/src/components/Step4Report.vue b/frontend/src/components/Step4Report.vue
index f44aedc..f383344 100644
--- a/frontend/src/components/Step4Report.vue
+++ b/frontend/src/components/Step4Report.vue
@@ -1887,14 +1887,29 @@ const renderMarkdown = (content) => {
// 处理引用块
html = html.replace(/^> (.+)$/gm, '
$1
')
- // 处理无序列表
- html = html.replace(/^- (.+)$/gm, '$1')
- html = html.replace(/([\s\S]*?<\/li>)(\s*.*<\/li>)+/g, '')
-
- // 处理有序列表
- html = html.replace(/^\d+\. (.+)$/gm, '$1')
- html = html.replace(/(.*<\/li>)+/g, '$&
')
+ // 处理列表 - 支持子列表
+ html = html.replace(/^(\s*)- (.+)$/gm, (match, indent, text) => {
+ const level = Math.floor(indent.length / 2)
+ return `${text}`
+ })
+ html = html.replace(/^(\s*)(\d+)\. (.+)$/gm, (match, indent, num, text) => {
+ const level = Math.floor(indent.length / 2)
+ return `${text}`
+ })
+
+ // 包装无序列表
+ html = html.replace(/(]*>.*?<\/li>\s*)+/g, '')
+ // 包装有序列表
+ html = html.replace(/(]*>.*?<\/li>\s*)+/g, '$&
')
+
+ // 清理列表项之间的所有空白
+ html = html.replace(/<\/li>\s+\s+/g, '')
+ html = html.replace(/\s+/g, '')
+ // 清理列表结束标签前的空白
+ html = html.replace(/\s+<\/ul>/g, '
')
+ html = html.replace(/\s+<\/ol>/g, '')
// 处理粗体和斜体
html = html.replace(/\*\*(.+?)\*\*/g, '$1')
@@ -1917,7 +1932,40 @@ const renderMarkdown = (content) => {
html = html.replace(/(<\/h[2-5]>)<\/p>/g, '$1')
html = html.replace(/(