From d08cc693b3927e197d55afca104d14115de8654a Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Sun, 30 Aug 2026 00:33:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20MarkdownRenderer=20=E5=86=85?= =?UTF-8?q?=E5=BB=BA=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=A0=B9?= =?UTF-8?q?=E6=B2=BB=E9=9D=9E=E8=81=8A=E5=A4=A9=E5=AE=B9=E5=99=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=81=8F=E5=B7=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 _resource-panel.scss 中仅绑定 .text-content 容器的列表样式补丁 - 列表样式(padding-left 缩进/list-style)迁移至 MarkdownRenderer 自身,任何容器(聊天/批准弹窗/预览等)渲染一致 - 解决计划批准弹窗等非 .text-content 容器内列表 marker 贴左、文字无缩进的问题 --- .../src/components/chat/MarkdownRenderer.vue | 28 +++++++++++++++++++ .../components/panels/_resource-panel.scss | 26 ----------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/static/src/components/chat/MarkdownRenderer.vue b/static/src/components/chat/MarkdownRenderer.vue index 6f5edfb7..b6421af2 100644 --- a/static/src/components/chat/MarkdownRenderer.vue +++ b/static/src/components/chat/MarkdownRenderer.vue @@ -107,4 +107,32 @@ watch(() => props.content, renderMath, { immediate: true }); .markdown-text-segment > *:last-child { margin-bottom: 0; } + +/* 列表基础样式(渲染器自有,不依赖外部容器类名): + 全局 reset 清掉了 ul/ol 默认 padding,此处置回标准缩进, + 保证 MarkdownRenderer 在任何容器内(聊天/批准弹窗/预览等)表现一致: + 标记在左、文字缩进靠右 */ +.markdown-text-segment :deep(ul), +.markdown-text-segment :deep(ol) { + padding-left: 24px; + margin-bottom: 12px; +} + +.markdown-text-segment :deep(ul) { + list-style-type: disc; +} + +.markdown-text-segment :deep(ul ul) { + list-style-type: circle; + margin-top: 6px; +} + +.markdown-text-segment :deep(ol) { + list-style-type: decimal; +} + +.markdown-text-segment :deep(li) { + margin-bottom: 6px; + line-height: 1.6; +} diff --git a/static/src/styles/components/panels/_resource-panel.scss b/static/src/styles/components/panels/_resource-panel.scss index 0bf7bfcc..0df34c5c 100644 --- a/static/src/styles/components/panels/_resource-panel.scss +++ b/static/src/styles/components/panels/_resource-panel.scss @@ -549,32 +549,6 @@ body[data-theme='dark'] { } } -/* Markdown列表样式 - 修复偏左问题 */ -.text-content ul, -.text-content ol { - margin-left: 24px; /* 增加左边距 */ - padding-left: 0; - margin-bottom: 12px; -} - -.text-content ul { - list-style-type: disc; /* 实心圆点 */ -} - -.text-content ul ul { - list-style-type: circle; /* 空心圆点 */ - margin-top: 6px; -} - -.text-content ol { - list-style-type: decimal; /* 数字列表 */ -} - -.text-content li { - margin-bottom: 6px; - line-height: 1.6; -} - /* 搜索结果展示 */ .search-meta { font-size: 14px;