Merge pull request #2598 from monter08/patch-1

Replace diacritics
This commit is contained in:
Jitendra Singh 2020-03-05 16:19:20 +05:30 committed by GitHub
commit 092ce8dbb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -7,8 +7,10 @@
target.value = e.target.value.toString()
.toLowerCase()
.normalize('NFKD') // Normalize Unicode
.replace(/[^\w- ]+/g, '')
// replace whitespaces with dashes
.replace(/ +/g, '-')
@ -21,4 +23,4 @@
el.addEventListener('input', handler);
}
}
</script>
</script>