Skip to content

Commit 296d3a8

Browse files
✨ feat: Use MarkdownHooks
1 parent f9d312e commit 296d3a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Markdown/SyntaxMarkdown/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use client';
22

3-
import 'katex/dist/contrib/mhchem';
43
import { memo, useMemo } from 'react';
5-
import ReactMarkdown from 'react-markdown';
4+
import { MarkdownHooks } from 'react-markdown';
65

76
import { PreviewGroup } from '@/Image';
87
import { useMarkdown, useMarkdownContent } from '@/hooks/useMarkdown';
@@ -29,14 +28,14 @@ const MarkdownRenderer = memo(
2928
}) => {
3029
return (
3130
<PreviewGroup enable={enableImageGallery}>
32-
<ReactMarkdown
31+
<MarkdownHooks
3332
{...reactMarkdownProps}
3433
components={memoComponents}
3534
rehypePlugins={rehypePluginsList}
3635
remarkPlugins={remarkPluginsList}
3736
>
3837
{escapedContent || ''}
39-
</ReactMarkdown>
38+
</MarkdownHooks>
4039
</PreviewGroup>
4140
);
4241
},

0 commit comments

Comments
 (0)