From 560833adb84363868c08245149c62d3d45a83095 Mon Sep 17 00:00:00 2001 From: wangxiaolei Date: Sun, 9 Nov 2025 21:39:05 +0800 Subject: [PATCH] fix: fix https://github.com/langgenius/dify/issues/27939 (#27985) --- web/app/styles/markdown.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/app/styles/markdown.scss b/web/app/styles/markdown.scss index 005685f0e8..a4c24787a7 100644 --- a/web/app/styles/markdown.scss +++ b/web/app/styles/markdown.scss @@ -856,6 +856,18 @@ color: var(--color-prettylights-syntax-comment); } +.markdown-body .katex { + /* Allow long inline formulas to wrap instead of overflowing */ + white-space: normal !important; + overflow-wrap: break-word; /* better cross-browser support */ + word-break: break-word; /* non-standard fallback for older WebKit/Blink */ +} + +.markdown-body .katex-display { + /* Fallback for very long display equations */ + overflow-x: auto; +} + .markdown-body .pl-c1, .markdown-body .pl-s .pl-v { color: var(--color-prettylights-syntax-constant);