For example a readable template
{{{
<input value="{% if a %}
this
{% else %}
that
{% endif %}">
}}}
It not parsed onto a single line, which is needed. How about adding the
option `-%}` to remove whitespace between the tag end and contents?
--
Ticket URL: <https://code.djangoproject.com/ticket/33329>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Thanks for this ticket, however there is no need for a new syntax, you can
use
[https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#spaceless
{% spaceless %}] for removing whitespace in rendered HTML.
--
Ticket URL: <https://code.djangoproject.com/ticket/33329#comment:1>
Comment (by sur.la.route):
Does that remove space inside attributes as well? Not just in surrounding
html?
--
Ticket URL: <https://code.djangoproject.com/ticket/33329#comment:2>
Comment (by Mariusz Felisiak):
Replying to [comment:2 sur.la.route]:
> Does that remove space inside attributes as well? Not just in
surrounding html?
You can use `spaceless` around the `value`, e.g.
{{{
<input value="{% spaceless %}{% if a %}
this
{% else %}
that
{% endif %}{% endspaceless %}">
}}}
Please use one of
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels] if you have further questions.
--
Ticket URL: <https://code.djangoproject.com/ticket/33329#comment:3>