Skip to content

Commit 4f01f1a

Browse files
committedAug 28, 2023
feat: allow overriding mdit-vue/component options
1 parent 21b4f8c commit 4f01f1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/node/markdown/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { componentPlugin } from '@mdit-vue/plugin-component'
1+
import {
2+
componentPlugin,
3+
type ComponentPluginOptions
4+
} from '@mdit-vue/plugin-component'
25
import {
36
frontmatterPlugin,
47
type FrontmatterPluginOptions
@@ -52,6 +55,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
5255
toc?: TocPluginOptions
5356
externalLinks?: Record<string, string>
5457
cache?: boolean
58+
component?: ComponentPluginOptions
5559
}
5660

5761
export type MarkdownRenderer = MarkdownIt
@@ -86,7 +90,7 @@ export const createMarkdownRenderer = async (
8690
}
8791

8892
// custom plugins
89-
md.use(componentPlugin)
93+
md.use(componentPlugin, { ...options.component })
9094
.use(highlightLinePlugin)
9195
.use(preWrapperPlugin, { hasSingleTheme })
9296
.use(snippetPlugin, srcDir)

0 commit comments

Comments
 (0)
Please sign in to comment.