Remove HTML tag when handling slug, fixed #49 (#50)

* Remove HTML tag when handling slug, fixed #49

* Fix slugify
This commit is contained in:
cinwell.li 2017-01-09 17:47:38 +08:00 committed by GitHub
commit 114955558e
2 changed files with 5 additions and 0 deletions

View file

@ -117,6 +117,7 @@ export function slugify (string) {
if (!maintainCase) string = string.toLowerCase()
let slug = string.trim()
.replace(/<[^>\d]+>/g, '')
.replace(re, '')
.replace(/\s/g, replacement)
let occurrences = slugify.occurrences[slug]