Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Problems trying to highlight inner single/double quotes #9

@brupelo

Description

@brupelo

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions