Fix: Use DOMPurify to filter out dangerous HTML #7668 (#7669)

### What problem does this PR solve?

Fix: Use DOMPurify to filter out dangerous HTML #7668

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2025-05-16 09:53:34 +08:00 committed by GitHub
parent 008e55a65e
commit d373c46976
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ const MarkdownContent = ({
const { setDocumentIds, data: fileThumbnails } = const { setDocumentIds, data: fileThumbnails } =
useFetchDocumentThumbnailsByIds(); useFetchDocumentThumbnailsByIds();
const contentWithCursor = useMemo(() => { const contentWithCursor = useMemo(() => {
let text = content; let text = DOMPurify.sanitize(content);
if (text === '') { if (text === '') {
text = t('chat.searching'); text = t('chat.searching');
} }