fixes in website page naming

This commit is contained in:
Nabin Hait 2013-01-17 13:24:51 +05:30
parent feee252093
commit 80c681294c

View File

@ -97,7 +97,14 @@ def page_name(title):
import re
name = title.lower()
name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
return '-'.join(name.split())
name = re.sub('[:/]', '-', name)
name = '-'.join(name.split())
# replace repeating hyphens
name = re.sub(r"(-)\1+", r"\1", name)
return name
def update_page_name(doc, title):
"""set page_name and check if it is unique"""