static: fix dashes being removed from slugs

This commit is contained in:
Jens Langhammer 2020-05-08 11:26:12 +02:00
parent 5400882d78
commit e1f0fe45cb
1 changed files with 2 additions and 2 deletions

View File

@ -41,8 +41,8 @@ document.querySelectorAll(".codemirror").forEach((cm) => {
const convertToSlug = (text) => { const convertToSlug = (text) => {
return text return text
.toLowerCase() .toLowerCase()
.replace(/[^\w ]+/g, '') .replace(/ /g, '-')
.replace(/ +/g, '-'); .replace(/[^\w-]+/g, '');
}; };
document.querySelectorAll("input[name=name]").forEach((input) => { document.querySelectorAll("input[name=name]").forEach((input) => {