Skip to content

Commit

Permalink
fix: emoji doesn't work in toc (close: #417) (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy authored and ulivz committed May 12, 2018
1 parent 5caefd9 commit 1b9012e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/util/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const spawn = require('cross-spawn')
const parseHeaders = require('./parseHeaders')

exports.parseHeaders = parseHeaders

exports.normalizeHeadTag = tag => {
if (typeof tag === 'string') {
tag = [tag]
Expand Down

0 comments on commit 1b9012e

Please sign in to comment.