File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -461,10 +461,3 @@ export const MDXComponents = annotateMDXComponents({
461461 YouTubeIframe,
462462 ErrorDecoder,
463463} ) ;
464-
465- // for (let key in MDXComponents) {
466- // if (MDXComponents.hasOwnProperty(key)) {
467- // const MDXComponent: any = (MDXComponents as any)[key];
468- // MDXComponent.mdxName = key;
469- // }
470- // }
Original file line number Diff line number Diff line change @@ -13,20 +13,21 @@ export const createFileMap = (codeSnippets: any) => {
1313 return codeSnippets . reduce (
1414 ( result : Record < string , SandpackFile > , codeSnippet : React . ReactElement ) => {
1515 // TODO: actually fix this
16- // if (
17- // (codeSnippet.type as any).mdxName !== 'pre' &&
18- // codeSnippet.type !== 'pre'
19- // ) {
20- // return result;
21- // }
2216 const { props} = (
2317 codeSnippet . props as PropsWithChildren < {
2418 children : ReactElement <
25- HTMLAttributes < HTMLDivElement > & { meta ?: string }
19+ HTMLAttributes < HTMLDivElement > & {
20+ meta ?: string ;
21+ 'data-mdx-name' ?: string ;
22+ }
2623 > ;
2724 } >
2825 ) . children ;
2926
27+ if ( props ?. [ 'data-mdx-name' ] !== 'code' ) {
28+ return result ;
29+ }
30+
3031 let filePath ; // path in the folder structure
3132 let fileHidden = false ; // if the file is available as a tab
3233 let fileActive = false ; // if the file tab is shown by default
You can’t perform that action at this time.
0 commit comments