File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
- import { MDXRemote as BaseMDXRemote } from 'next-mdx-remote-client/rsc' ;
1
+ import { MDXRemote as BaseMDXRemote , MDXComponents } from 'next-mdx-remote-client/rsc' ;
2
2
import { SerializeOptions } from 'next-mdx-remote-client/serialize' ;
3
3
import rehypeKatex from 'rehype-katex' ;
4
4
import remarkGfm from 'remark-gfm' ;
@@ -11,17 +11,20 @@ export async function MDXRemote({
11
11
source,
12
12
mdxOptions,
13
13
scope,
14
+ components,
14
15
parseFrontmatter,
15
16
} : {
16
17
source : string ;
17
18
mdxOptions ?: SerializeOptions [ 'mdxOptions' ] ;
18
19
scope ?: SerializeOptions [ 'scope' ] ;
20
+ components ?: MDXComponents ;
19
21
parseFrontmatter ?: SerializeOptions [ 'parseFrontmatter' ] ;
20
22
} ) {
21
23
return (
22
24
// @ts -expect-error Server Component
23
25
< BaseMDXRemote
24
26
source = { source }
27
+ components = { components }
25
28
options = { {
26
29
scope,
27
30
mdxOptions : {
@@ -33,12 +36,7 @@ export async function MDXRemote({
33
36
] ,
34
37
rehypePlugins : [
35
38
rehypeKatex ,
36
- [
37
- rehypeSyntaxHighlighting ,
38
- {
39
- ignoreMissing : true ,
40
- } ,
41
- ] ,
39
+ [ rehypeSyntaxHighlighting , { ignoreMissing : true } ] ,
42
40
...( mdxOptions ?. rehypePlugins || [ ] ) ,
43
41
] ,
44
42
format : mdxOptions ?. format || 'mdx' ,
You can’t perform that action at this time.
0 commit comments