Skip to content

Commit

Permalink
fix: Unload markdown-it-anchor plugin
Browse files Browse the repository at this point in the history
markown-it-chain 取消加载anchor插件
  • Loading branch information
leo committed Nov 19, 2020
1 parent d4f8561 commit 1ef5f10
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions build/md-loader/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Config = require('markdown-it-chain')
const anchorPlugin = require('markdown-it-anchor')
const slugify = require('transliteration').slugify
// const anchorPlugin = require('markdown-it-anchor')
// const slugify = require('transliteration').slugify
const hljs = require('highlight.js')

const containers = require('./containers')
Expand All @@ -22,21 +22,24 @@ config.options
.highlight(highlight)
.end()

.plugin('anchor')
.use(anchorPlugin, [
{
level: 2,
slugify: slugify,
permalink: true,
permalinkBefore: true
}
])
.end()

.plugin('containers')
.use(containers)
.end()

// 这个插件生成的 href 没有带前缀,导致报错,
// 例如:http://0.0.0.0:8086/#/npm-an-zhuang
// http://0.0.0.0:8086/#/zh-CN/component/installation#npm-an-zhuang
// .plugin('anchor')
// .use(anchorPlugin, [
// {
// level: 2,
// slugify: slugify,
// permalink: true,
// permalinkBefore: true
// }
// ])
// .end()

const md = config.toMd()
overWriteFenceRule(md)

Expand Down

0 comments on commit 1ef5f10

Please sign in to comment.