提交 1b9012ea 编写于 作者: L Liu Xinyu 提交者: ULIVZ

fix: emoji doesn't work in toc (close: #417) (#418)

上级 5caefd9c
......@@ -8,6 +8,7 @@ const emoji = require('markdown-it-emoji')
const anchor = require('markdown-it-anchor')
const toc = require('markdown-it-table-of-contents')
const _slugify = require('./slugify')
const { parseHeaders } = require('../util')
module.exports = ({ markdown = {}} = {}) => {
// allow user config slugify
......@@ -37,7 +38,8 @@ module.exports = ({ markdown = {}} = {}) => {
}, markdown.anchor))
.use(toc, Object.assign({
slugify,
includeLevel: [2, 3]
includeLevel: [2, 3],
format: parseHeaders
}, markdown.toc))
// apply user config
......
const spawn = require('cross-spawn')
const parseHeaders = require('./parseHeaders')
exports.parseHeaders = parseHeaders
exports.normalizeHeadTag = tag => {
if (typeof tag === 'string') {
tag = [tag]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册