#33329 closed New feature (invalid)
Allow more whitespace control on template tags
Reported by: | sur.la.route | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 3.2 |
Severity: | Normal | Keywords: | space control template |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When putting template tags inside of html attributes the surrounding whitespace is not removed.
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?
Change History (3)
comment:1 by , 3 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 3 years ago
Does that remove space inside attributes as well? Not just in surrounding html?
comment:3 by , 3 years ago
Replying to 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 support channels if you have further questions.
Thanks for this ticket, however there is no need for a new syntax, you can use {% spaceless %} for removing whitespace in rendered HTML.