I am iterating over a dictionary in Python. The values that contain &
are converted to &
. How Do I stop that? It shows on the web page like this:
Hobbies & Leisure
My code looks like this:
{% for k,v in vertical.iteritems() %}
{value: '{{k}}', text: "{{v}}"},
{% endfor %}
You can try the safe
Jinja filter.
http://jinja.pocoo.org/docs/templates/#safe
{% for k, v in vertical.iteritems() %}
{value: '{{ k|safe }}', text: "{{ v|safe }}"},
{% endfor %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With