BREAKING CHANGE: markdown.headers is now disabled by default

pull/2104/head
Evan You 2 years ago
parent 468c049ccd
commit 2bf8df4bae

@ -44,7 +44,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
}
defaultHighlightLang?: string
frontmatter?: FrontmatterPluginOptions
headers?: HeadersPluginOptions | false
headers?: HeadersPluginOptions | boolean
sfc?: SfcPluginOptions
theme?: ThemeOptions
languages?: ILanguageRegistration[]
@ -120,11 +120,11 @@ export const createMarkdownRenderer = async (
...options.frontmatter
} as FrontmatterPluginOptions)
if (options.headers !== false) {
if (options.headers) {
md.use(headersPlugin, {
level: [2, 3, 4, 5, 6],
slugify,
...options.headers
...(typeof options.headers === 'boolean' ? undefined : options.headers)
} as HeadersPluginOptions)
}

Loading…
Cancel
Save