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:
Gary Wilson Jr 2007-07-15 05:03:28 +00:00
parent eff675b91e
commit b68f188628
4 changed files with 117 additions and 1 deletions

View file

@ -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):