Fixed number at the beginning of the slug, fixed #51
This commit is contained in:
parent
f7779b01d9
commit
b8b9dbc872
2 changed files with 6 additions and 0 deletions
|
|
@ -1,3 +1,7 @@
|
|||
## 1.5.2
|
||||
### Bug fixes
|
||||
- Fixed number at the beginning of the slug
|
||||
|
||||
## 1.5.1
|
||||
### Bug fixes
|
||||
- Remove HTML tag when handling slug
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ export function slugify (string) {
|
|||
.replace(/<[^>\d]+>/g, '')
|
||||
.replace(re, '')
|
||||
.replace(/\s/g, replacement)
|
||||
.replace(/-+/g, replacement)
|
||||
.replace(/^(\d)/, '_$1')
|
||||
let occurrences = slugify.occurrences[slug]
|
||||
|
||||
if (slugify.occurrences.hasOwnProperty(slug)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue