valyala / quicktemplate

Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiline attribute is broken when using stripspace

arch-mage opened this issue · comments

template

{% stripspace %}
{% func Page() %}
<form
  method="post"
>
  <input
    type="text"
    />
</form>
{% endfunc %}
{% endstripspace %}

output

<formmethod="post"><inputtype="text"/></form>

expected output

<form method="post"><input type="text"/></form>

{%stripspace%} strips all the whitespace between lines. Try using{%collapsespace%} instead, which collapses whitespace between lines into a single space. Another solution is to insert explicit {%space%}, which is never removed.

Oh, I see. I miss understood.