diff --git a/.gitignore b/.gitignore index 20de73e8a..acdb55a20 100644 --- a/.gitignore +++ b/.gitignore @@ -43,11 +43,11 @@ model-assets/ openspec/ logs/ +.agents/ .devspace/ devspace.yaml k8s/helm/**/*.tgz k8s/helm/nexent/Chart.lock MAC_DEVELOPMENT_GUIDE.md -# Mac本地开发数据持久化(无需提交) data/ diff --git a/frontend/components/ui/markdownRenderer.tsx b/frontend/components/ui/markdownRenderer.tsx index 4eadd837c..53dfb6962 100644 --- a/frontend/components/ui/markdownRenderer.tsx +++ b/frontend/components/ui/markdownRenderer.tsx @@ -974,20 +974,19 @@ export const CodeBlock: React.FC<{ }> = ({ codeContent, language = "python" }) => { const { t } = useTranslation("common"); - const customStyle = { +const customStyle = { ...oneLight, 'pre[class*="language-"]': { ...oneLight['pre[class*="language-"]'], background: "#f8f8f8", - borderRadius: "0", - padding: "12px 16px", margin: "0", + padding: "1rem", fontSize: "0.875rem", lineHeight: "1.5", whiteSpace: "pre-wrap", wordWrap: "break-word", - wordBreak: "break-word", - overflowWrap: "break-word", + wordBreak: "normal", + overflowWrap: "anywhere", overflow: "auto", width: "100%", boxSizing: "border-box", @@ -1002,8 +1001,8 @@ export const CodeBlock: React.FC<{ lineHeight: "1.5", whiteSpace: "pre-wrap", wordWrap: "break-word", - wordBreak: "break-word", - overflowWrap: "break-word", + wordBreak: "normal", + overflowWrap: "anywhere", width: "100%", padding: "0", display: "block", diff --git a/frontend/styles/react-markdown.css b/frontend/styles/react-markdown.css index 19578e557..31788f998 100644 --- a/frontend/styles/react-markdown.css +++ b/frontend/styles/react-markdown.css @@ -516,6 +516,12 @@ opacity: 0.7; } +/* Ensure Prism tokens display inline within code blocks */ +.code-block-content .token, +.code-block-content span[class*="token"] { + display: inline; +} + .token.comment { font-style: italic; color: #6a9955;