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

Loading…
Cancel
Save