11import { compile , compileSync , run , runSync } from "@mdx-js/mdx"
2+ import rehypeShiki from "@shikijs/rehype"
23import theme from "dev/highlighter-theme.json"
34import { getSingletonHighlighter } from "shiki"
45import { createEffect , createRenderEffect , createSignal , type JSX , Show } from "solid-js"
56import { Dynamic } from "solid-js/web"
67import * as runtime from "solid-jsx"
78
8-
9- import rehypeShiki from "@shikijs/rehype"
10-
119interface MDXProps {
1210 code : string
1311 components ?: Record < string , any >
@@ -90,9 +88,9 @@ export const MDXContent = (props: MDXProps): JSX.Element => {
9088 rehypePlugins : [
9189 [
9290 rehypeShiki , // Adds syntax-highlighting for code blocks.
93- { theme : theme }
94- ]
95- ]
91+ { theme : theme } ,
92+ ] ,
93+ ] ,
9694 } )
9795 setMdxModule ( await run ( String ( compiled ) , { ...( runtime as any ) , baseUrl : import . meta. url } ) )
9896 } catch ( e ) {
@@ -112,7 +110,6 @@ export const MDXContent = (props: MDXProps): JSX.Element => {
112110 const Content = ( ) => mdxModule ( ) ?. default || ( ( ) => null )
113111
114112 return Content as unknown as JSX . Element
115-
116113}
117114
118115// export const MDXContent = (props: MDXProps): JSX.Element => {
@@ -129,7 +126,6 @@ export const MDXContent = (props: MDXProps): JSX.Element => {
129126// return Content as unknown as JSX.Element
130127// }
131128
132-
133129export const MDXContentStatic = ( props : MDXProps ) : JSX . Element => {
134130 try {
135131 const compiled = compileSync ( props . code , {
0 commit comments