kudago / jinja2-tmbundle

Jinja2 Syntax Support for TextMate and Sublime Text
18 stars 9 forks source link

Problems trying to highlight inner single/double quotes #9

Open brupelo opened 4 years ago

brupelo commented 4 years ago

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 commented 4 years ago

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.