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
Post a Comment