Commit 6f0c622 1 parent 22a3acc commit 6f0c622 Copy full SHA for 6f0c622
File tree 2 files changed +10
-24
lines changed
2 files changed +10
-24
lines changed Original file line number Diff line number Diff line change @@ -307,9 +307,6 @@ export default defineNuxtModule<ModuleOptions>({
307
307
)
308
308
} )
309
309
310
- // Add Content plugin
311
- addPlugin ( resolveRuntimeModule ( './plugins/ws' ) )
312
-
313
310
nuxt . hook ( 'nitro:config' , ( nitroConfig ) => {
314
311
// Init Nitro context
315
312
nitroConfig . prerender = nitroConfig . prerender || { }
@@ -541,27 +538,6 @@ export default defineNuxtModule<ModuleOptions>({
541
538
] )
542
539
}
543
540
544
- // Register anchor link generation
545
- if ( options . markdown . anchorLinks === true ) {
546
- options . markdown . anchorLinks = {
547
- depth : 6 ,
548
- exclude : [ ]
549
- }
550
- } else if ( options . markdown . anchorLinks === false ) {
551
- options . markdown . anchorLinks = {
552
- depth : 0 ,
553
- exclude : [ ]
554
- }
555
- } else {
556
- options . markdown . anchorLinks = {
557
- ...{
558
- depth : 4 ,
559
- exclude : [ 1 ]
560
- } ,
561
- ...options . markdown . anchorLinks
562
- }
563
- }
564
-
565
541
// @ts -ignore
566
542
await nuxt . callHook ( 'content:context' , contentContext )
567
543
@@ -651,6 +627,10 @@ export default defineNuxtModule<ModuleOptions>({
651
627
} )
652
628
return
653
629
}
630
+ // ~~ DEV ~~ //
631
+
632
+ // Add Content plugin
633
+ addPlugin ( resolveRuntimeModule ( './plugins/ws' ) )
654
634
655
635
nuxt . hook ( 'nitro:init' , async ( nitro ) => {
656
636
if ( ! options . watch || ! options . watch . ws ) { return }
Original file line number Diff line number Diff line change @@ -154,8 +154,14 @@ export function createWebSocket () {
154
154
}
155
155
156
156
export function processMarkdownOptions ( options : ModuleOptions [ 'markdown' ] ) {
157
+ // Refine anchor link generation
158
+ const anchorLinks = typeof options . anchorLinks === 'boolean'
159
+ ? { depth : options . anchorLinks ? 6 : 0 , exclude : [ ] }
160
+ : { depth : 4 , exclude : [ 1 ] , ...options . anchorLinks }
161
+
157
162
return {
158
163
...options ,
164
+ anchorLinks,
159
165
remarkPlugins : resolveMarkdownPlugins ( options . remarkPlugins ) ,
160
166
rehypePlugins : resolveMarkdownPlugins ( options . rehypePlugins )
161
167
}
You can’t perform that action at this time.
0 commit comments