Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

fix: correctly escapes user content in search results

Daniel Avilab496174b4c75
diff --git a/client/src/components/Messages/Content/Content.jsx b/client/src/components/Messages/Content/Content.jsx
index 03f565175d..e240c9986f 100644
--- a/client/src/components/Messages/Content/Content.jsx
+++ b/client/src/components/Messages/Content/Content.jsx
@@ -8,8 +8,8 @@ import rehypeRaw from 'rehype-raw'
import CodeBlock from './CodeBlock';
import { langSubset } from '~/utils/languages';
-const Content = React.memo(({ content, isCreatedByUser = false }) => {
- const rehypePlugins = [
+const Content = React.memo(({ content, isCreatedByUser = true }) => {
+ let rehypePlugins = [
[rehypeKatex, { output: 'mathml' }],
[
rehypeHighlight,
@@ -20,12 +20,15 @@ const Content = React.memo(({ content, isCreatedByUser = false }) => {
}
],
[rehypeRaw],
- ]
+ ];
+
+ rehypePlugins = isCreatedByUser ? rehypePlugins.slice(0, -1) : rehypePlugins;
+
return (
<>
<ReactMarkdown
remarkPlugins={[remarkGfm, [remarkMath, { singleDollarTextMath: false }]]}
- rehypePlugins={isCreatedByUser ? rehypePlugins.slice(-1) : rehypePlugins}
+ rehypePlugins={rehypePlugins}
linkTarget="_new"
components={{
code,