File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ export default defineConfig({
15
15
head : [ [ 'meta' , { name : 'theme-color' , content : '#3c8772' } ] ] ,
16
16
17
17
markdown : {
18
- headers : {
19
- level : [ 0 , 0 ]
20
- }
18
+ headers : false
21
19
} ,
22
20
23
21
themeConfig : {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
44
44
}
45
45
defaultHighlightLang ?: string
46
46
frontmatter ?: FrontmatterPluginOptions
47
- headers ?: HeadersPluginOptions
47
+ headers ?: HeadersPluginOptions | false
48
48
sfc ?: SfcPluginOptions
49
49
theme ?: ThemeOptions
50
50
languages ?: ILanguageRegistration [ ]
@@ -101,17 +101,21 @@ export const createMarkdownRenderer = async (
101
101
slugify,
102
102
permalink : anchorPlugin . permalink . ariaHidden ( { } ) ,
103
103
...options . anchor
104
- } as anchorPlugin . AnchorOptions )
105
- . use ( frontmatterPlugin , {
106
- ...options . frontmatter
107
- } as FrontmatterPluginOptions )
108
- . use ( headersPlugin , {
104
+ } as anchorPlugin . AnchorOptions ) . use ( frontmatterPlugin , {
105
+ ...options . frontmatter
106
+ } as FrontmatterPluginOptions )
107
+
108
+ if ( options . headers !== false ) {
109
+ md . use ( headersPlugin , {
109
110
level : [ 2 , 3 , 4 , 5 , 6 ] ,
111
+ slugify,
110
112
...options . headers
111
113
} as HeadersPluginOptions )
112
- . use ( sfcPlugin , {
113
- ...options . sfc
114
- } as SfcPluginOptions )
114
+ }
115
+
116
+ md . use ( sfcPlugin , {
117
+ ...options . sfc
118
+ } as SfcPluginOptions )
115
119
. use ( titlePlugin )
116
120
. use ( tocPlugin , {
117
121
...options . toc
You can’t perform that action at this time.
0 commit comments