Can I suppress newlines after each template tag with Django's template engine?

后端 未结 5 2315
醉梦人生
醉梦人生 2021-02-19 08:05

In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags:

    <% for @item in @items -%>
  • <%= @item %>
5条回答
  •  爱一瞬间的悲伤
    2021-02-19 08:53

    {% spaceless %}
    
    • apple
    • banana
    • cacao
    {% endspaceless %}

    I am not aware about any way to discard template tags lines. I'd vote for opening bug report.

提交回复
热议问题