From e1f0fe45cbb787e5fd75b6280b2c40d52e2e4caa Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 8 May 2020 11:26:12 +0200 Subject: [PATCH] static: fix dashes being removed from slugs --- passbook/static/static/passbook/pf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/static/static/passbook/pf.js b/passbook/static/static/passbook/pf.js index 99f8609cd..4a8780884 100644 --- a/passbook/static/static/passbook/pf.js +++ b/passbook/static/static/passbook/pf.js @@ -41,8 +41,8 @@ document.querySelectorAll(".codemirror").forEach((cm) => { const convertToSlug = (text) => { return text .toLowerCase() - .replace(/[^\w ]+/g, '') - .replace(/ +/g, '-'); + .replace(/ /g, '-') + .replace(/[^\w-]+/g, ''); }; document.querySelectorAll("input[name=name]").forEach((input) => {