Ticket #3532: reintroduce_space.diff
File reintroduce_space.diff, 823 bytes (added by , 17 years ago) |
---|
-
django/utils/html.py
59 59 60 60 def strip_spaces_between_tags(value): 61 61 """Returns the given HTML with spaces between tags removed.""" 62 return re.sub(r'>\s+<', '><', force_unicode(value)) 62 value = re.sub(r'>\s+<', '><', force_unicode(value)) 63 # Re-introduce the space between '/a>' and '<a ' adjacent anchor tags that enclose text 64 # This is necessarily complex in order to avoid anchor tags between, say, 2 images having a space added 65 return re.sub(r'(\w)<\/a><a(\s+[^>]*)>(?=\w)', r'\1</a> <a\2>', force_unicode(value)) 63 66 strip_spaces_between_tags = allow_lazy(strip_spaces_between_tags, unicode) 64 67 65 68 def strip_entities(value):