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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -