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

@ -1,3 +1,7 @@
## 1.5.1
### Bug fixes
- Remove HTML tag when handling slug
## 1.5.0
### Bug fixes

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]