@@ -99,6 +99,8 @@ export type Options = {
9999 * Add babel plugins.
100100 */
101101 babelPlugins? : PluginItem [];
102+ /** Do you want to parse the title*/
103+ isHeading? : boolean
102104}
103105` ` `
104106
@@ -112,6 +114,7 @@ import mdObj from 'markdown-react-code-preview-loader/README.md';
112114mdObj .source // => `README.md` raw string text
113115mdObj .components // => The component index object, the React component converted from the markdown indexed example. (need to configure meta)
114116mdObj .data // => The component source code index object, the sample source code indexed from markdown. (need to configure meta)
117+ mdObj .headings // => This is the parsed header data
115118```
116119
117120``` js
@@ -133,7 +136,8 @@ mdObj.data // => The component source code index object, the sample source
133136 }
134137 },
135138 components: { 77 : ƒ, demo12: ƒ },
136- source: " # Alert 确认对话框...."
139+ source: " # Alert 确认对话框...." ,
140+ headings: [{depth: 1 ,value: " 标题" , ... },... ]
137141}
138142```
139143
@@ -155,6 +159,7 @@ export type CodeBlockData = {
155159 source: string ;
156160 components: Record <CodeBlockItem [' name' ], React .FC >;
157161 data: Record <CodeBlockItem [' name' ], CodeBlockItem >;
162+ headings? : HeadingItem []
158163};
159164```
160165
0 commit comments