24 lines
410 B
TypeScript
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,
|
|
},
|
|
}
|
|
})
|