Skip to content

Commit

Permalink
support cyrilic in slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Kuleshov committed Apr 6, 2012
1 parent 79450c2 commit d4f97dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/locomotive/utils/core_ext.js
Expand Up @@ -18,7 +18,7 @@

String.prototype.slugify = function(sep) {
if (typeof sep == 'undefined') sep = '_';
var alphaNumRegexp = new RegExp('[^a-zA-Z0-9\\' + sep + ']', 'g');
var alphaNumRegexp = new RegExp('[^a-zA-Z0-9а-яА-Я\\' + sep + ']', 'g');
var avoidDuplicateRegexp = new RegExp('[\\' + sep + ']{2,}', 'g');
return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase()
}
Expand Down

0 comments on commit d4f97dc

Please sign in to comment.