> Django templates are useful (and used) for all sorts of text-based
> formats. For some of these, an exact control over whitespace is needed
> throughout the entire file (eg. text/plain),

Agreed.  When I started using Django templates I was very surprised at
the output I was seeing.

After a while I realised that the thing that suprised me was that
newlines were being output for what I considered to be just
'directives' -- that is, lines that contained tags, not content.  For
example, {% if %} and {% endif %} tags on lines by themselves.

Honestly, my use case then was to make my HTML look pretty, so was
able to let it go pretty easily.  Recently however I used the template
system to produce an email with a textual pricing table, and there the
lack of easy whitespace control hurt there.

Would it be feasible to add some logic, something along the lines of:

"Template lines containing just tags with no literal content do not
produce a line in the output  (unless of course the tag itself
produces one)"

After all, new lines are easy to add, but currently painful to suppress...

Cheers,

    Leon

--
Leon Matthews BSc
Technical Director, Messiah Ltd.
work: http://messiah.co.nz/
home: http://lost.co.nz/

-- 
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 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to