Fixed a regression when updating javascript stringify. Fixes #355.

This commit is contained in:
Mario Visic 2012-04-13 22:11:44 +08:00
parent d0698b1ffc
commit edca6323fb
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@
String.prototype.slugify = function(sep) {
if (typeof sep == 'undefined') sep = '_';
var alphaNumRegexp = new RegExp('[^\w\\' + sep + ']', 'g');
var alphaNumRegexp = new RegExp('[^\\w\\' + sep + ']', 'g');
var avoidDuplicateRegexp = new RegExp('[\\' + sep + ']{2,}', 'g');
return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase()
}