forked from hexojs/hexo-renderer-markdown-it
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
31 lines (26 loc) · 889 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* global hexo */
'use strict';
hexo.config.markdown = Object.assign({
render: {
html: true,
xhtmlOut: false,
breaks: true,
linkify: true,
typographer: true,
quotes: '“”‘’'
},
anchors: {
level: 2,
collisionSuffix: ''
}
}, hexo.config.markdown);
const renderer = require('./lib/renderer');
const katex = require('./lib/katex');
hexo.extend.renderer.register('md', 'html', renderer, true);
hexo.extend.renderer.register('markdown', 'html', renderer, true);
hexo.extend.renderer.register('mkd', 'html', renderer, true);
hexo.extend.renderer.register('mkdn', 'html', renderer, true);
hexo.extend.renderer.register('mdwn', 'html', renderer, true);
hexo.extend.renderer.register('mdtxt', 'html', renderer, true);
hexo.extend.renderer.register('mdtext', 'html', renderer, true);
hexo.extend.filter.register('after_render:html', katex.filter);