-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
index.js
39 lines (34 loc) · 1.03 KB
/
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
32
33
34
35
36
37
38
39
/* global hexo */
'use strict';
const renderer = require('./lib/renderer');
hexo.config.marked = Object.assign({
gfm: true,
pedantic: false,
breaks: true,
smartLists: true,
smartypants: true,
modifyAnchors: 0,
autolink: true,
mangle: true,
sanitizeUrl: false,
dompurify: false,
headerIds: true,
anchorAlias: false,
lazyload: false,
prependRoot: true,
postAsset: false,
external_link: {
enable: false,
exclude: [],
nofollow: false
},
descriptionLists: true
}, hexo.config.marked);
renderer.disableNunjucks = Boolean(hexo.config.marked.disableNunjucks);
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);