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

Loading…
Cancel
Save