id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux
1067,"""Spaceless"" tag, removes spaces between html nodes",brantley (deadwisdom@…,Adrian Holovaty,"This is a cool tag that I think should be added to the defaults, it removes spaces between HTML tags. This is a problem many designers has banged their heads against many walls over, where spaces between tags show up even though they are clearly not inteded to be there.
So this:
{{{
{% spaceless %}
{% endspaceless %}
}}}
Renders as:
{{{
}}}
{{{
import re
re_spaceless = re.compile("">\s+<"")
def do_spaceless(parser, token):
nodelist = parser.parse(('endspaceless',))
parser.delete_first_token()
return SpacelessNode(nodelist)
class SpacelessNode(template.Node):
def __init__(self, nodelist):
self.nodelist = nodelist
def render(self, context):
rendered = self.nodelist.render(context).strip()
return re_spaceless.sub(""><"", rendered)
}}}",enhancement,closed,Template system,,normal,fixed,,,Unreviewed,0,0,0,0,0,0