﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
299	Slugify shouldn't remove hyphens	gch@…	Adrian Holovaty	"Example python session:
{{{
>>> from django.core.defaultfilters import slugify
>>> slugify('Django Rocks!', None) 
'django-rocks'
>>> slugify('django-rocks', None)
'djangorocks'
}}}

Personally, I think it makes much more sense to not have it remove the hyphens.  Basically, you want slugify(slugify(slugify(X))) to equal slugify(X).

The simple fix here is the following diff
{{{
Index: defaultfilters.py
===================================================================
--- defaultfilters.py   (revision 463)
+++ defaultfilters.py   (working copy)
@@ -54,7 +54,7 @@
  
 def slugify(value, _):
     ""Converts to lowercase, removes non-alpha chars and converts spaces to hyphens""
-    value = re.sub('[^\w\s]', '', value).strip().lower()
+    value = re.sub('[^\w\s-]', '', value).strip().lower()
     return re.sub('\s+', '-', value)
      
 def stringformat(value, arg):
}}}"	defect	closed	contrib.admin		normal	fixed			Ready for checkin	0	0	0	0	0	0
