jinja2 - How can I comment in a Jinja directive? -


i have jinja set directive follows:

{% set mylist = [   "item 1",   "another item",   "yet item", ] %} 

i add comment second list item. jinja support that? i've tried following:

{% set mylist = [   "item 1",   "another item",  # comment   "yet item", ] %} 

and

{% set mylist = [   "item 1",   "another item",  ## comment   "yet item", ] %} 

, none of them work. i'm using jinja 2.6.

no, jinja not support inline comments. however, can use comment block:

{# bug: added "another item" because of raisins. don't remove until #12345 fixed #} {% set mylist = [   "item 1",   "another item",   "yet item", ] %} 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -