Ticket #8123: utils-spaceless.diff

File utils-spaceless.diff, 658 bytes (added by Julian Bez, 16 years ago)

First patch proposal

  • django/utils/html.py

     
    5959
    6060def strip_spaces_between_tags(value):
    6161    """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    value = re.sub(r'([^(em|strong|a)])>\s+<', r'\1><', value)
     64    return re.sub(r'>\s+<([^(em|strong|a)])', r'><\1', value)
    6365strip_spaces_between_tags = allow_lazy(strip_spaces_between_tags, unicode)
    6466
    6567def strip_entities(value):
Back to Top