pyjade
pyjade copied to clipboard
{{ }} is not getting parsed by pyjade as expected with django
I have line of pyjade
a.js-track(data-track-data="{\"Job ID\":\"{{ job_details|get_or_na:'id' }}\",\"Job Title\":\"{{ job_details|get_or_na:'title' }}\",\"Company Name\":\"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}\"}", data-track-dynamic-attrs="[\"Stakeholder\"]",href="{% url 'job_detail' job_details.title|slugify job_details.id %}")
which is being rendered as
<a href="/job/operations-manager/b1ac846e-6834-40c4-8bcf-122c093820b1/" data-track-data="{"Job ID":"{{ job_details|get_or_na:'id' }}","Job Title":"{{ job_details|get_or_na:'title' }}","Company Name":"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}"}" data-track-dynamic-attrs="["Stakeholder"]" class="js-track">
I expect it to {{ }} being replaced by intended values rather than being rendered with html.
I am using 4.0.0 version of pyjade here as templating language.
Link to bug created on stack overflow: http://stackoverflow.com/questions/37006480/is-not-getting-parsed-by-pyjade-as-expected-with-django Link to issue on django: https://code.djangoproject.com/ticket/26598#ticket
I also have same issue. Did you solve it?
Why do you sometimes use {% .... %}
and sometimes {{ ... }}
for properties that should be rendered?