Skip to content

Commit

Permalink
fix: handle headers that start with numbers (fix #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 18, 2018
1 parent 5f7e199 commit ad83169
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/markdown/slugify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit ad83169

Please sign in to comment.