WebIndex/plugins/markdown-it.ts
2025-01-13 23:12:06 +08:00

24 lines
410 B
TypeScript

import md, { type Options } from 'markdown-it'
import mm from 'markdown-it-mathjax3'
const options: Options = {
breaks: true,
html: true,
langPrefix: 'language-',
linkify: true,
quotes: '“”‘’',
typographer: true,
xhtmlOut: true,
}
export default defineNuxtPlugin(() => {
const render = md(options)
.use(mm, {
})
return {
provide: {
mdRender: render,
},
}
})