Fixed #700 -- urlify.js now uses hyphens instead of underscores

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-10-28 03:41:39 +00:00
parent e7c870c36e
commit c6f375fd11
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ function URLify(s, num_chars) {
s = s.replace(r, '');
s = s.replace(/[^\w\s-]/g, ''); // remove unneeded chars
s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
s = s.replace(/\s+/g, '_'); // convert spaces to underscores
s = s.replace(/\s+/g, '-'); // convert spaces to hyphens
s = s.toLowerCase(); // convert to lowercase
return s.substring(0, num_chars);// trim to first num_chars chars
}