Fix slugify
This commit is contained in:
parent
9ce47c48af
commit
424a243c5c
3 changed files with 11 additions and 15 deletions
|
|
@ -10,6 +10,7 @@ const CACHE = {}
|
|||
const renderTo = function (dom, content) {
|
||||
dom = typeof dom === 'object' ? dom : document.querySelector(dom)
|
||||
dom.innerHTML = content
|
||||
slugify.clear()
|
||||
|
||||
return dom
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ export function slugify (string) {
|
|||
const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g
|
||||
const maintainCase = false
|
||||
const replacement = '-'
|
||||
|
||||
slugify.occurrences = slugify.occurrences || {}
|
||||
|
||||
if (typeof string !== 'string') return ''
|
||||
|
|
@ -134,3 +135,7 @@ export function slugify (string) {
|
|||
|
||||
return slug
|
||||
}
|
||||
|
||||
slugify.clear = function () {
|
||||
slugify.occurrences = {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue