Skip to content

Node.js based forum software built for the modern web

so xregexp uses double backslashes...

Julian Lamf7b7af3004ec
diff --git a/public/src/utils.js b/public/src/utils.js
index 8f74cb1344..6eea61113d 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -95,7 +95,7 @@
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
slugify: function(str) {
- var invalidChars = XRegExp('[^\\p{L} 0-9\-_]', 'g');
+ var invalidChars = XRegExp('[^\\p{L}\\s\\d\\-_]', 'g');
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();