|
|
|
@ -13,7 +13,7 @@ import {
|
|
|
|
|
import { sfcPlugin, type SfcPluginOptions } from '@mdit-vue/plugin-sfc'
|
|
|
|
|
import { titlePlugin } from '@mdit-vue/plugin-title'
|
|
|
|
|
import { tocPlugin, type TocPluginOptions } from '@mdit-vue/plugin-toc'
|
|
|
|
|
import { slugify } from '@mdit-vue/shared'
|
|
|
|
|
import { slugify as defaultSlugify } from '@mdit-vue/shared'
|
|
|
|
|
import type {
|
|
|
|
|
LanguageInput,
|
|
|
|
|
ShikiTransformer,
|
|
|
|
@ -232,6 +232,8 @@ export async function createMarkdownRenderer(
|
|
|
|
|
await options.preConfig(md)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const slugify = options.anchor?.slugify ?? defaultSlugify
|
|
|
|
|
|
|
|
|
|
// custom plugins
|
|
|
|
|
md.use(componentPlugin, { ...options.component })
|
|
|
|
|
.use(highlightLinePlugin)
|
|
|
|
@ -243,7 +245,7 @@ export async function createMarkdownRenderer(
|
|
|
|
|
linkPlugin,
|
|
|
|
|
{ target: '_blank', rel: 'noreferrer', ...options.externalLinks },
|
|
|
|
|
base,
|
|
|
|
|
options.anchor?.slugify ?? slugify
|
|
|
|
|
slugify
|
|
|
|
|
)
|
|
|
|
|
.use(lineNumberPlugin, options.lineNumbers)
|
|
|
|
|
|
|
|
|
@ -318,6 +320,7 @@ export async function createMarkdownRenderer(
|
|
|
|
|
} as SfcPluginOptions)
|
|
|
|
|
.use(titlePlugin)
|
|
|
|
|
.use(tocPlugin, {
|
|
|
|
|
slugify,
|
|
|
|
|
...options.toc
|
|
|
|
|
} as TocPluginOptions)
|
|
|
|
|
|
|
|
|
|