Refine Jinja2 Template
I have a Jinja2 template that I would like to use, but cannot combine with exaggerating code. This question has been asked before, but there hasn't been an answer after almost two years, so maybe there is an answer.
<select id="example-getting-started" name="test" multiple="multiple">
{% for k in pizza_dict %}
<option value="{{ k }}" {% if pizza_dict[k] %}selected{% endif %}>{{ k }}</option>
{% endfor %}
</select>
BeautifulSoup and lxml will "prefix" this code:
<select id="example-getting-started" multiple="multiple" name="test">
{% for k in pizza_dict %}
<option endif="" if="" pizza_dict="" value="{{ k }}"> {{ k }} </option>
{% endfor %} </select>
which will destroy the function of the code.
+3
Michael K
source
to share
No one has answered this question yet
See similar questions:
36
eleven
0
or similar:
257
164
127
116
97
96
61
27
1
0