sanitize promptReply Output

This commit is contained in:
Timothy Carambat 2026-03-12 20:51:05 -07:00
parent c76576a9da
commit 9e2d144dc8

View File

@ -2,6 +2,7 @@
import { memo, useRef, useEffect } from "react";
import { Warning } from "@phosphor-icons/react";
import renderMarkdown from "@/utils/chat/markdown";
import DOMPurify from "@/utils/chat/purify";
import Citations from "../Citation";
import {
THOUGHT_REGEX_CLOSE,
@ -96,7 +97,9 @@ function RenderAssistantChatContent({ message, messageId }) {
)}
<span
className="break-words"
dangerouslySetInnerHTML={{ __html: renderMarkdown(contentRef.current) }}
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(renderMarkdown(contentRef.current)),
}}
/>
</div>
);