Include numeric chars in slugify function. Fixes #294

This commit is contained in:
benweet 2014-02-02 19:18:05 +00:00
parent 54c3f138df
commit bde5c8672a

View File

@ -152,7 +152,7 @@ define([
};
// Slug function
var nonWordChars = XRegExp('[^\\p{L}-]', 'g');
var nonWordChars = XRegExp('[^\\p{L}\\p{N}-]', 'g');
utils.slugify = function(text) {
return text.toLowerCase().replace(/\s/g, '-') // Replace spaces with -
.replace(nonWordChars, '') // Remove all non-word chars