|
|
@ -44,7 +44,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defaultHighlightLang?: string
|
|
|
|
defaultHighlightLang?: string
|
|
|
|
frontmatter?: FrontmatterPluginOptions
|
|
|
|
frontmatter?: FrontmatterPluginOptions
|
|
|
|
headers?: HeadersPluginOptions
|
|
|
|
headers?: HeadersPluginOptions | false
|
|
|
|
sfc?: SfcPluginOptions
|
|
|
|
sfc?: SfcPluginOptions
|
|
|
|
theme?: ThemeOptions
|
|
|
|
theme?: ThemeOptions
|
|
|
|
languages?: ILanguageRegistration[]
|
|
|
|
languages?: ILanguageRegistration[]
|
|
|
@ -101,17 +101,21 @@ export const createMarkdownRenderer = async (
|
|
|
|
slugify,
|
|
|
|
slugify,
|
|
|
|
permalink: anchorPlugin.permalink.ariaHidden({}),
|
|
|
|
permalink: anchorPlugin.permalink.ariaHidden({}),
|
|
|
|
...options.anchor
|
|
|
|
...options.anchor
|
|
|
|
} as anchorPlugin.AnchorOptions)
|
|
|
|
} as anchorPlugin.AnchorOptions).use(frontmatterPlugin, {
|
|
|
|
.use(frontmatterPlugin, {
|
|
|
|
...options.frontmatter
|
|
|
|
...options.frontmatter
|
|
|
|
} as FrontmatterPluginOptions)
|
|
|
|
} as FrontmatterPluginOptions)
|
|
|
|
|
|
|
|
.use(headersPlugin, {
|
|
|
|
if (options.headers !== false) {
|
|
|
|
|
|
|
|
md.use(headersPlugin, {
|
|
|
|
level: [2, 3, 4, 5, 6],
|
|
|
|
level: [2, 3, 4, 5, 6],
|
|
|
|
|
|
|
|
slugify,
|
|
|
|
...options.headers
|
|
|
|
...options.headers
|
|
|
|
} as HeadersPluginOptions)
|
|
|
|
} as HeadersPluginOptions)
|
|
|
|
.use(sfcPlugin, {
|
|
|
|
}
|
|
|
|
...options.sfc
|
|
|
|
|
|
|
|
} as SfcPluginOptions)
|
|
|
|
md.use(sfcPlugin, {
|
|
|
|
|
|
|
|
...options.sfc
|
|
|
|
|
|
|
|
} as SfcPluginOptions)
|
|
|
|
.use(titlePlugin)
|
|
|
|
.use(titlePlugin)
|
|
|
|
.use(tocPlugin, {
|
|
|
|
.use(tocPlugin, {
|
|
|
|
...options.toc
|
|
|
|
...options.toc
|
|
|
|