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

后端 未结 5 2311
醉梦人生
醉梦人生 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:59

    When you write a template, you could open the ul hardcoded in the template and looping trought items en returning there value with the in it.

    As far as i know there isn't a default function for that.

提交回复
热议问题