File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {
1313import { sfcPlugin , type SfcPluginOptions } from '@mdit-vue/plugin-sfc'
1414import { titlePlugin } from '@mdit-vue/plugin-title'
1515import { tocPlugin , type TocPluginOptions } from '@mdit-vue/plugin-toc'
16- import { slugify } from '@mdit-vue/shared'
16+ import { slugify as defaultSlugify } from '@mdit-vue/shared'
1717import type {
1818 LanguageInput ,
1919 ShikiTransformer ,
@@ -232,6 +232,8 @@ export async function createMarkdownRenderer(
232232 await options . preConfig ( md )
233233 }
234234
235+ const slugify = options . anchor ?. slugify ?? defaultSlugify
236+
235237 // custom plugins
236238 md . use ( componentPlugin , { ...options . component } )
237239 . use ( highlightLinePlugin )
@@ -243,7 +245,7 @@ export async function createMarkdownRenderer(
243245 linkPlugin ,
244246 { target : '_blank' , rel : 'noreferrer' , ...options . externalLinks } ,
245247 base ,
246- options . anchor ?. slugify ?? slugify
248+ slugify
247249 )
248250 . use ( lineNumberPlugin , options . lineNumbers )
249251
@@ -318,6 +320,7 @@ export async function createMarkdownRenderer(
318320 } as SfcPluginOptions )
319321 . use ( titlePlugin )
320322 . use ( tocPlugin , {
323+ slugify,
321324 ...options . toc
322325 } as TocPluginOptions )
323326
You can’t perform that action at this time.
0 commit comments