Skip to content

Commit

Permalink
feat: allow overriding mdit-vue/component options
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Aug 28, 2023
1 parent 21b4f8c commit 4f01f1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/node/markdown/index.ts
@@ -1,4 +1,7 @@
import { componentPlugin } from '@mdit-vue/plugin-component'
import {
componentPlugin,
type ComponentPluginOptions
} from '@mdit-vue/plugin-component'
import {
frontmatterPlugin,
type FrontmatterPluginOptions
Expand Down Expand Up @@ -52,6 +55,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
toc?: TocPluginOptions
externalLinks?: Record<string, string>
cache?: boolean
component?: ComponentPluginOptions
}

export type MarkdownRenderer = MarkdownIt
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4f01f1a

Please sign in to comment.