allow underscores in slugs

This commit is contained in:
Julian Lam
2014-01-05 12:55:39 -05:00
parent 6567819294
commit 5a88a5ca60

View File

@@ -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} 0-9\-_]', 'g');
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();