mirror of
https://github.com/django/django.git
synced 2025-09-15 15:05:14 +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:
parent
eff675b91e
commit
b68f188628
4 changed files with 117 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue