Fixed slugify function

This commit is contained in:
benweet 2013-10-03 02:02:18 +01:00
parent 7085c8b13a
commit c17d35015b

View File

@ -2,9 +2,10 @@ define([
"jquery",
"underscore",
"crel",
"xregexp",
"FileSaver",
"stacktrace",
], function($, _, crel) {
], function($, _, crel, XRegExp) {
var utils = {};
@ -149,7 +150,7 @@ define([
// Slug function
utils.slugify = function(text) {
return text.toLowerCase().replace(/\s/g, '-') // Replace spaces with -
.replace(/![\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]/g, '') // Remove
.replace(XRegExp('[^\\p{L}]', 'g'), '') // Remove
// all
// non-word
// chars