mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-29 18:57:36 +08:00
27 lines
582 B
JavaScript
27 lines
582 B
JavaScript
|
const Config = require('markdown-it-chain');
|
||
|
const anchorPlugin = require('markdown-it-anchor');
|
||
|
const slugify = require('transliteration').slugify;
|
||
|
const containers = require('./containers');
|
||
|
const overWriteFenceRule = require('./fence');
|
||
|
|
||
|
const config = new Config();
|
||
|
|
||
|
config
|
||
|
.options.html(true).end()
|
||
|
|
||
|
.plugin('anchor').use(anchorPlugin, [
|
||
|
{
|
||
|
level: 2,
|
||
|
slugify: slugify,
|
||
|
permalink: true,
|
||
|
permalinkBefore: true
|
||
|
}
|
||
|
]).end()
|
||
|
|
||
|
.plugin('containers').use(containers).end();
|
||
|
|
||
|
const md = config.toMd();
|
||
|
overWriteFenceRule(md);
|
||
|
|
||
|
module.exports = md;
|