feat: allow overriding mdit-vue/component options

pull/2876/head
Divyansh Singh 1 year ago
parent 21b4f8caad
commit 4f01f1a09c

@ -1,4 +1,7 @@
import { componentPlugin } from '@mdit-vue/plugin-component'
import {
componentPlugin,
type ComponentPluginOptions
} from '@mdit-vue/plugin-component'
import {
frontmatterPlugin,
type FrontmatterPluginOptions
@ -52,6 +55,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
toc?: TocPluginOptions
externalLinks?: Record<string, string>
cache?: boolean
component?: ComponentPluginOptions
}
export type MarkdownRenderer = MarkdownIt
@ -86,7 +90,7 @@ export const createMarkdownRenderer = async (
}
// custom plugins
md.use(componentPlugin)
md.use(componentPlugin, { ...options.component })
.use(highlightLinePlugin)
.use(preWrapperPlugin, { hasSingleTheme })
.use(snippetPlugin, srcDir)

Loading…
Cancel
Save