File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change 11import data from 'react-code-preview-layout/README.md' ;
22import CodeLayout from 'react-code-preview-layout' ;
33import MarkdownPreview from '@uiw/react-markdown-preview' ;
4- import { getCodeString } from 'rehype-rewrite' ;
54import { getMetaId , isMeta , getURLParameters } from 'markdown-react-code-preview-loader' ;
65
76const Doc = ( ) => (
@@ -18,7 +17,7 @@ const Doc = () => (
1817 const metaId = getMetaId ( meta ) || String ( line ) ;
1918 const Child = data . components [ `${ metaId } ` ] ;
2019 if ( metaId && typeof Child === 'function' ) {
21- const code = getCodeString ( node . children ) ;
20+ const code = data . data [ metaId ] . value || '' ;
2221 const param = getURLParameters ( meta ) ;
2322 return (
2423 < CodeLayout toolbar = { param . title || '示例展示' } code = { < code { ...rest } /> } text = { code } >
You can’t perform that action at this time.
0 commit comments