From 98712cf04745c4f81bf3f53a295b1374c42770ac Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Fri, 5 Jun 2026 16:44:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B6=88=E9=99=A4=20code-block-body=20?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2=E4=B8=8E=20shiki=20=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=83=8C=E6=99=AF=E8=89=B2=E8=A7=86=E8=A7=89=E5=89=B2?= =?UTF-8?q?=E8=A3=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/features/chat/parts/CodeBlock.tsx | 8 +++++--- src/web/styles.css | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/web/features/chat/parts/CodeBlock.tsx b/src/web/features/chat/parts/CodeBlock.tsx index 6895b8c..2558955 100644 --- a/src/web/features/chat/parts/CodeBlock.tsx +++ b/src/web/features/chat/parts/CodeBlock.tsx @@ -63,9 +63,11 @@ export function CodeBlock({ children, className: _className, isStreaming }: Code {highlighted ? (
) : ( -
-          {codeText}
-        
+
+
+            {codeText}
+          
+
)}
); diff --git a/src/web/styles.css b/src/web/styles.css index 50c3d97..6ed9c9c 100644 --- a/src/web/styles.css +++ b/src/web/styles.css @@ -408,9 +408,12 @@ body { .code-block-body { margin: 0; +} + +.code-block-body > pre { padding: var(--ant-padding-sm); + margin: 0; overflow-x: auto; - background: var(--ant-color-bg-container); } .code-block-body code {