@@ -3,8 +3,8 @@ import ReactMarkdown, { type UrlTransform } from 'react-markdown';
3
3
import { type PluggableList } from 'unified' ;
4
4
import gfm from 'remark-gfm' ;
5
5
import raw from 'rehype-raw' ;
6
+ import { remarkAlert } from 'remark-github-blockquote-alert' ;
6
7
import { useCopied } from './plugins/useCopied' ;
7
- import { remarkAlert } from './plugins/remarkAlert' ;
8
8
import { type MarkdownPreviewProps , type MarkdownPreviewRef } from './Props' ;
9
9
import './styles/markdown.less' ;
10
10
@@ -34,7 +34,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
34
34
useImperativeHandle ( ref , ( ) => ( { ...props , mdp } ) , [ mdp , props ] ) ;
35
35
const cls = `${ prefixCls || '' } ${ className || '' } ` ;
36
36
useCopied ( mdp ) ;
37
- const rehypePlugins : PluggableList = [ [ remarkAlert ] , ...( other . rehypePlugins || [ ] ) ] ;
37
+ const rehypePlugins : PluggableList = [ ...( other . rehypePlugins || [ ] ) ] ;
38
38
const customProps : MarkdownPreviewProps = {
39
39
allowElement : ( element , index , parent ) => {
40
40
if ( other . allowElement ) {
@@ -46,7 +46,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
46
46
if ( skipHtml ) {
47
47
rehypePlugins . push ( raw ) ;
48
48
}
49
- const remarkPlugins = [ ...( other . remarkPlugins || [ ] ) , gfm ] ;
49
+ const remarkPlugins = [ remarkAlert , ...( other . remarkPlugins || [ ] ) , gfm ] ;
50
50
const wrapperProps = { ...warpperElement , ...wrapperElement } ;
51
51
return (
52
52
< div ref = { mdp } onScroll = { onScroll } onMouseOver = { onMouseOver } { ...wrapperProps } className = { cls } style = { style } >
0 commit comments