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);
|
|