I never really liked how the templating system leaves all those
newlines.  This middleware is cool, but it would really be nice if the
templating system could collapse the lines that only contain one or
more evaluating-to-nothing template tags.

Thoughts on a possible implementation:

What if an endofline token were added. Lexer.tokenize() creates the
tokens and Parser.parse() creates the nodelist like normal.  Each node
in the nodelist is rendered, except for endofline nodes.  Pass through
nodelist again, removing whitespace-strings and empty-strings if those
whitespace-strings and empty-strings are all that exist between two
endofline nodes.  The endofline nodes following removed
whitespace-strings or empty-strings are also removed, while all other
endifline nodes get rendered to a newline.  Join and return rendered
nodelist like normal.

Would this work?  Is there a better way?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to