mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: add rehype-sanitize for enhanced Markdown security
- Added rehype-sanitize as a dependency to sanitize Markdown content. - Updated the Markdown component to include rehype-sanitize in the rehypePlugins for improved security against XSS attacks.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import rehypeSanitize from 'rehype-sanitize';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface MarkdownProps {
|
||||
@@ -44,7 +45,7 @@ export function Markdown({ children, className }: MarkdownProps) {
|
||||
className
|
||||
)}
|
||||
>
|
||||
<ReactMarkdown rehypePlugins={[rehypeRaw]}>{children}</ReactMarkdown>
|
||||
<ReactMarkdown rehypePlugins={[rehypeRaw, rehypeSanitize]}>{children}</ReactMarkdown>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user