mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #4310 -- Fixed a regular expression bug in strip_entities function and added tests for several django.utils.html functions. Based on patch from Brian Harring.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -50,7 +50,7 @@ strip_spaces_between_tags = allow_lazy(strip_spaces_between_tags, unicode)
|
||||
|
||||
def strip_entities(value):
|
||||
"Returns the given HTML with all entities (&something;) stripped"
|
||||
return re.sub(r'&(?:\w+|#\d);', '', force_unicode(value))
|
||||
return re.sub(r'&(?:\w+|#\d+);', '', force_unicode(value))
|
||||
strip_entities = allow_lazy(strip_entities, unicode)
|
||||
|
||||
def fix_ampersands(value):
|
||||
|
||||
Reference in New Issue
Block a user