@@ -3,8 +3,8 @@ import ReactMarkdown, { type UrlTransform } from 'react-markdown';
33import { type PluggableList } from 'unified' ;
44import gfm from 'remark-gfm' ;
55import raw from 'rehype-raw' ;
6+ import { remarkAlert } from 'remark-github-blockquote-alert' ;
67import { useCopied } from './plugins/useCopied' ;
7- import { remarkAlert } from './plugins/remarkAlert' ;
88import { type MarkdownPreviewProps , type MarkdownPreviewRef } from './Props' ;
99import './styles/markdown.less' ;
1010
@@ -34,7 +34,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
3434 useImperativeHandle ( ref , ( ) => ( { ...props , mdp } ) , [ mdp , props ] ) ;
3535 const cls = `${ prefixCls || '' } ${ className || '' } ` ;
3636 useCopied ( mdp ) ;
37- const rehypePlugins : PluggableList = [ [ remarkAlert ] , ...( other . rehypePlugins || [ ] ) ] ;
37+ const rehypePlugins : PluggableList = [ ...( other . rehypePlugins || [ ] ) ] ;
3838 const customProps : MarkdownPreviewProps = {
3939 allowElement : ( element , index , parent ) => {
4040 if ( other . allowElement ) {
@@ -46,7 +46,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
4646 if ( skipHtml ) {
4747 rehypePlugins . push ( raw ) ;
4848 }
49- const remarkPlugins = [ ...( other . remarkPlugins || [ ] ) , gfm ] ;
49+ const remarkPlugins = [ remarkAlert , ...( other . remarkPlugins || [ ] ) , gfm ] ;
5050 const wrapperProps = { ...warpperElement , ...wrapperElement } ;
5151 return (
5252 < div ref = { mdp } onScroll = { onScroll } onMouseOver = { onMouseOver } { ...wrapperProps } className = { cls } style = { style } >
0 commit comments