From f98d2aaffbef2ffa000ec4eb697291d93cce24e5 Mon Sep 17 00:00:00 2001 From: fatelei Date: Mon, 29 Dec 2025 11:55:03 +0800 Subject: [PATCH] fix: fix markdown escape issue --- .../components/base/chat/chat/answer/basic-content.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/chat/chat/answer/basic-content.tsx b/web/app/components/base/chat/chat/answer/basic-content.tsx index ed8f83d6a9..cda2dd6ffb 100644 --- a/web/app/components/base/chat/chat/answer/basic-content.tsx +++ b/web/app/components/base/chat/chat/answer/basic-content.tsx @@ -18,12 +18,19 @@ const BasicContent: FC = ({ if (annotation?.logAnnotation) return + // Preserve Windows UNC paths and similar backslash-heavy strings by + // wrapping them in inline code so Markdown renders backslashes verbatim. + let displayContent = content + if (typeof content === 'string' && /^\\\\\S.*/.test(content) && !/^`.*`$/.test(content)) { + displayContent = `\`${content}\`` + } + return ( ) }