diff --git a/web/app/components/base/markdown-blocks/think-block.tsx b/web/app/components/base/markdown-blocks/think-block.tsx
index b68aff293d..3398502cfd 100644
--- a/web/app/components/base/markdown-blocks/think-block.tsx
+++ b/web/app/components/base/markdown-blocks/think-block.tsx
@@ -68,6 +68,9 @@ export const ThinkBlock = ({ children, ...props }: any) => {
const displayContent = removeEndThink(children)
const { t } = useTranslation()
+ if (!(props['data-think'] ?? false))
+ return ({children} )
+
return (
diff --git a/web/app/components/base/markdown.tsx b/web/app/components/base/markdown.tsx
index 8689d44a1c..51c54b7d7d 100644
--- a/web/app/components/base/markdown.tsx
+++ b/web/app/components/base/markdown.tsx
@@ -68,13 +68,9 @@ const preprocessLaTeX = (content: string) => {
}
const preprocessThinkTag = (content: string) => {
- if (!(content.trim().startsWith('\n') || content.trim().startsWith('\n', '\n'),
- (str: string) => str.replaceAll('\n ', '\n[ENDTHINKFLAG]
'),
- (str: string) => str.replaceAll('\n', '\n[ENDTHINKFLAG]'),
+ (str: string) => str.replace('\n', '\n'),
+ (str: string) => str.replace('\n ', '\n[ENDTHINKFLAG]'),
])(content)
}