gerson
2025-01-21 952977720041f6332e08609f22774a844c725e18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// import highlight from 'highlight.js';
import Markdown from 'markdown-it';
 
const mdOptions: Markdown.Options = {
    linkify: true,
    typographer: true,
    breaks: true,
    langPrefix: 'language-',
    // 代码高亮
    // hightlight 加载过慢
    // highlight(str, lang) {
    //     if (lang && highlight.getLanguage(lang)) {
    //         try {
    //             return '<pre class="hljs"><code>' + highlight.highlight(lang, str, true).value + '</code></pre>';
    //         } catch (__) {
    //   }
    //     }
    //     return '';
    // },
};
 
export const md = new Markdown(mdOptions);