repair the js slugify method
This commit is contained in:
parent
9dc3f778a4
commit
a507d756b7
@ -18,9 +18,9 @@
|
||||
|
||||
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()
|
||||
return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase();
|
||||
}
|
||||
|
||||
window.addParameterToURL = function(key, value, context) { // code from http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript
|
||||
|
Loading…
Reference in New Issue
Block a user