From b3aae4347b30c534ff6193233d2bc0474f43f5f6 Mon Sep 17 00:00:00 2001 From: MoeexT Date: Fri, 15 May 2026 17:01:58 +0800 Subject: [PATCH 1/2] :bug: Fix markdown code block display error --- .gitignore | 1 + frontend/components/ui/markdownRenderer.tsx | 13 ++++++------- frontend/styles/react-markdown.css | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 20de73e8a..2151761bd 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ model-assets/ openspec/ logs/ +.agents/ .devspace/ devspace.yaml k8s/helm/**/*.tgz 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; From 7828201b4890d8f66bd53000f930aeef0f9b3f67 Mon Sep 17 00:00:00 2001 From: MoeexT Date: Fri, 15 May 2026 17:24:07 +0800 Subject: [PATCH 2/2] :bug: Fix markdown code block display error --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2151761bd..acdb55a20 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,4 @@ k8s/helm/**/*.tgz k8s/helm/nexent/Chart.lock MAC_DEVELOPMENT_GUIDE.md -# Mac本地开发数据持久化(无需提交) data/