Commits

Kevin Chan committed cca32fe

Added strip_accents filter to slugify function and cleaned up function code.

  • Participants
  • Parent commits 12ca604
  • Tags 0.1.5

Comments (0)

Files changed (1)

garage/slugify.py

 Functions to create slugs.
 
 * created: 2011-02-15 Kevin Chan <kefin@makedostudio.com>
-* updated: 2013-01-12 kchan
+* updated: 2013-01-14 kchan
 """
 
 import re
     s = s.decode("utf-8")
     s = s.strip(u"\r\n")
     s = s.replace(u"\n", u" ")
-    s = re.sub(r'[¡]', u'', s)
-    s = s.replace(u"’", u"'")
+    s = strip_accents(s)
     s = strip_tags(unescape(s))
     s = re.sub(r"['’]s", u's', s)
     s = re.sub(r'([0-9\.]+)%', u'\\1-percent', s)
     s = s.replace(u"&amp;", u" and ")
     s = s.replace(u"&", u" and ")
+    s = s.replace(u"/", u" ")
     s = s.replace(u" ", u"-")
     s = s.replace(u"_", u"-")
     s = convert_unwanted_chars(s)