fix: 消除 code-block-body 背景色与 shiki 主题背景色视觉割裂

This commit is contained in:
2026-06-05 16:44:13 +08:00
parent 85abc2a515
commit 98712cf047
2 changed files with 9 additions and 4 deletions

View File

@@ -63,9 +63,11 @@ export function CodeBlock({ children, className: _className, isStreaming }: Code
{highlighted ? (
<div className="code-block-body" dangerouslySetInnerHTML={{ __html: highlighted }} />
) : (
<pre className="code-block-body">
<code>{codeText}</code>
</pre>
<div className="code-block-body">
<pre>
<code>{codeText}</code>
</pre>
</div>
)}
</div>
);

View File

@@ -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 {