Skip to content

Commit

Permalink
Merge pull request pmcelhaney#1 from hbasria/master
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcelhaney committed Jun 30, 2011
2 parents 4b9a176 + 8c6fb5a commit 4087f99
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jquery.slugify.js
Expand Up @@ -13,6 +13,13 @@
return settings.slugFunc(val,
(function(v) {
if (!v) return '';
var from = "ıİöÖüÜçÇğĞşŞâÂêÊîÎôÔûÛ";
var to = "iIoOuUcCgGsSaAeEiIoOuU";

for (var i=0, l=from.length ; i<l ; i++) {
v = v.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}

return v.replace(/'/g, '').replace(/\s*&\s*/g, ' and ').replace(/[^A-Za-z0-9]+/g, '-').replace(/^-|-$/g, '').toLowerCase();
})
);
Expand Down

0 comments on commit 4087f99

Please sign in to comment.