feat(build): add `markdown.preConfig` option

closes #1382
pull/2733/head
Divyansh Singh 1 year ago
parent 7141b82ccc
commit ce85726c12

@ -34,6 +34,7 @@ export type ThemeOptions =
export interface MarkdownOptions extends MarkdownIt.Options {
lineNumbers?: boolean
preConfig?: (md: MarkdownIt) => void
config?: (md: MarkdownIt) => void
anchor?: anchorPlugin.AnchorOptions
attrs?: {
@ -76,10 +77,14 @@ export const createMarkdownRenderer = async (
logger
)),
...options
}) as MarkdownRenderer
})
md.linkify.set({ fuzzyLink: false })
if (options.preConfig) {
options.preConfig(md)
}
// custom plugins
md.use(componentPlugin)
.use(highlightLinePlugin)

Loading…
Cancel
Save