Hi,
On Saturday, February 25, 2012 5:27:43 AM UTC+1, Tai Lee wrote:
>
> Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for
> x in y -%}), multi-line comment tags that don't actually include a
> comment, and half baked comment tags (where the closing tag is
> assumed) are all going to make templates uglier, and harder to read.
>
"-" is only supposed to be used in some edge cases where it's really
important that you don't have whitespace, usually there is no reason to
care for whitespace at all -- so it shouldn't make templates that ugly if
you don't use it everywhere.
{% stripwhitespace on %} at the top of your template, followed by {% for
> x in y %}? I think the latter is far more readable.
>
Usually I don't want to strip everything, but just at one location.
> My ideal solution is not to add new ways to mark each individual
> template tag that should have surrounding white space stripped, but to
> simply enable the removal of lines that have only block tags and no
> actual content. 99% of the time this is the right thing to do, and we
> just need a deprecation path and new template tag so that template
> authors can opt-in to the new behaviour now.
>
And what about the other 1%, there are even cases where whitespace is
important ;) Either way, why is stripping whitespace the right thing to do?
Given my experience "I don't care if there is or not" is what's 99% true of
the time…
Cheers,
Florian
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-developers/-/lyV4D4i58I4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.