提交 ad83169f 编写于 作者: E Evan You

fix: handle headers that start with numbers (fix #121)

上级 5f7e1996
......@@ -15,6 +15,8 @@ module.exports = function slugify (str) {
.replace(/\-{2,}/g, '-')
// Remove prefixing and trailing separtors
.replace(/^\-+|\-+$/g, '')
// ensure it doesn't start with a number (#121)
.replace(/^(\d)/, '_$1')
// lowercase
.toLowerCase()
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册