Skip to content

Nunjucks tags inside HTML <style> element #24

@jparise

Description

@jparise

Given a line like this within an .njk file using the (auto-detected) HTML language mode with Better Nunjucks installed:

<style>{% getBundle "css" %}</style>

... it appears the CSS syntax takes precedence. The {% and "css" tokens are marked as CSS syntax errors in the IDE, and the line will be reformatted as:

<style>
    {
        % getBundle "css" %
    }
</style>

... which breaks the Nunjacks syntax.

I'm also using the HTML CSS Support, but I still see the problem if I disable that extension.

Switching to Nunjucks language mode fixes these issues at the loss of some HTML and CSS language awareness. (Highlighting works, completions do not.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions