root / trunk / html / __init__.py

Revision 167, 408 bytes (checked in by akaihola, 10 months ago)

[html] Oops, missing a colon.

  • Property svn:eol-style set to native
Line 
1# -*- coding: utf-8 -*-
2
3"""HTML utilities suitable for global use."""
4
5import re
6
7from django.utils.functional import allow_lazy
8from django.utils.encoding import force_unicode
9
10def strip_empty_lines(value):
11    """Return the given HTML with empty and all-whitespace lines removed."""
12    return re.sub(r'\n[ \t]*(?=\n)', '', force_unicode(value))
13strip_empty_lines = allow_lazy(strip_empty_lines, unicode)
Note: See TracBrowser for help on using the browser.