sanitize titles while they are being typed

This commit is contained in:
2024-02-23 22:31:15 -05:00
parent 362c406471
commit 22ccea893c
13 changed files with 116 additions and 100 deletions

View File

@ -0,0 +1,10 @@
export default {
SanitizeTitles (context) {
context.el.addEventListener('keyup', (e) => {
e.target.value = e.target.value
.replace(' ', '-')
.replace(/[^a-zA-Z0-9-]/, '')
})
},
mounted () { this.SanitizeTitles(this) }
}