import { FC } from 'react'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import rehypeHighlight from 'rehype-highlight'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import 'highlight.js/styles/github-dark.css'; import { defaultSchema } from 'hast-util-sanitize'; import { cn } from '../../lib/cn'; const schema = { ...defaultSchema, attributes: { ...defaultSchema.attributes, div: [ ...(defaultSchema.attributes?.div || []), ['style'], // разрешаем атрибут style на div ], }, }; interface MarkdownPreviewProps { content: string; className?: string; } const MarkdownPreview: FC = ({ content, className = '', }) => { return (
{content}
); }; export default MarkdownPreview;