Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems trying to highlight inner single/double quotes #9

Open
brupelo opened this issue Jun 22, 2020 · 1 comment
Open

Problems trying to highlight inner single/double quotes #9

brupelo opened this issue Jun 22, 2020 · 1 comment

Comments

@brupelo
Copy link

brupelo commented Jun 22, 2020

Hi, first of all, thanks to fork and maintain this nice package. I've recently started to learn & use jinja2 and I find it really handy.

Here's the thing, I've found there is a problem when trying to render inner single/double quotes in html tags, example below:

foo.html.j2

{% macro test1(card) %}
    <select>
        <option {% if card.status=='badboy1' %}selected{% endif %}></option>
    </select>
{% endmacro %}

{% macro test2(card) %}
    <select>
        <option {% if card.status=="badboy2" %}selected{% endif %}></option>
    </select>
{% endmacro %}

They'll be rendered like this:

showcase

Is this because I'm doing something wrong here or it's just a bug that needs to be fixed?

Thanks in advance!

@UltraInstinct05
Copy link

You maybe interested in BetterJinja. I've rewritten the syntax from scratch so that it can take advantage of the Default HTML syntax improvements. Plus it also provides a few nice features as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants