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

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

    The closest I've found to what you're looking for (I'm looking for the same thing) is talk about a future patch, here: http://code.djangoproject.com/ticket/2594.

    Unfortunately, it looks like there's not much you can do until they merge that patch in.

提交回复
热议问题