samuelcolvin / jinjahtml-vscode

Syntax highlighting for jinja(2) html templates in vscode
https://marketplace.visualstudio.com/items?itemName=samuelcolvin.jinjahtml
MIT License
135 stars 53 forks source link

Broken highlighting in Jinja CSS #137

Open nokyotsu opened 1 year ago

nokyotsu commented 1 year ago

If I type the following into vscode:

body {
    color: {{ color("gray", 800) }};
    background-color: {{ color("white") }};
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 20px;
}

I get the following highlighting:

Screenshot 2023-05-22 at 15 37 17

It seems that the highlighter is getting confused by the {{ ... }} used by jinja.

stanmertens commented 1 year ago

Thanks for mentioning this, I ran into the same issue. If you change the double-quotes to single-quotes inside {{ ... }} it will work, but unfortunately my jinja linter doesn't like that.

cquick01 commented 1 year ago

Might be related to #107 . It seems like the single curly brackets are causing issues when jinja delimiters are used within.

I am seeing a similar issue with jinja-cpp:

image

which has the same issue (at least with comment coloring) as the CSS example

image