Fix handling of apostrophe in title.

This commit is contained in:
Thomas Gideon 2011-06-18 15:45:00 -04:00
parent d740c98b52
commit a9c17a7b59

View file

@ -180,6 +180,7 @@ def __permalink(title):
def __title(title):
fixed = title
fixed = re.sub(u'\u2013', '-', fixed)
fixed = re.sub(u'\u2019', '\'', fixed)
return fixed
@ -230,6 +231,7 @@ def __archive_slug(title):
"""
slug = re.sub('\([^0-9]\)-\([^0-9]\)', '\1\2', title)
slug = re.sub(u'\u2013', '-', slug)
slug = re.sub(u'\u2019', '', slug)
slug = re.sub('[^A-Za-z0-9\-\.]', ' ', slug)
slug = re.sub(' {2,}', ' ', slug)
tokens = slug.split(' ')