improve generation of slugs

This commit is contained in:
Herbert Maschke 2019-11-25 15:16:21 +01:00 committed by David Große
parent 1048cbc5c9
commit 3efe3a7f61
2 changed files with 11 additions and 7 deletions

3
.gitignore vendored
View File

@ -5,7 +5,6 @@
/public/js
/public/vendor
/public/themes
/storage/*.key
/vendor
/.idea
/.vscode
@ -21,3 +20,5 @@ yarn.lock
package-lock.json
yarn.lock
.php_cs.cache
storage/
storage/*.key

View File

@ -1,12 +1,15 @@
<script>
export default {
bind(el, binding, vnode) {
let handler = function(e) {
setTimeout(function() {
e.target.value = e.target.value.toString().toLowerCase()
.replace(/[^\w- ]+/g,'')
.trim()
.replace(/ +/g,'-');
let handler = function (e) {
setTimeout(function () {
e.target.value = e.target.value
.toString()
.toLowerCase()
.replace(/[^\w- ]+/g, '')
.replace(/ +/g, '-')
.replace('![-\s]+!u', '-')
.trim();
}, 100);
}