mirror of
https://github.com/django/django.git
synced 2025-09-22 18:22:40 +00:00
Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
This commit is contained in:
parent
17677d510f
commit
8119b679eb
42 changed files with 82 additions and 82 deletions
|
@ -423,11 +423,11 @@ def slugify(value, allow_unicode=False):
|
|||
value = force_text(value)
|
||||
if allow_unicode:
|
||||
value = unicodedata.normalize('NFKC', value)
|
||||
value = re.sub('[^\w\s-]', '', value, flags=re.U).strip().lower()
|
||||
return mark_safe(re.sub('[-\s]+', '-', value, flags=re.U))
|
||||
value = re.sub(r'[^\w\s-]', '', value, flags=re.U).strip().lower()
|
||||
return mark_safe(re.sub(r'[-\s]+', '-', value, flags=re.U))
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
|
||||
value = re.sub('[^\w\s-]', '', value).strip().lower()
|
||||
return mark_safe(re.sub('[-\s]+', '-', value))
|
||||
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
|
||||
return mark_safe(re.sub(r'[-\s]+', '-', value))
|
||||
|
||||
|
||||
def camel_case_to_spaces(value):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue