g-plane / markup_fmt

Configurable HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks and Vento formatter with dprint integration.
https://dprint.dev/plugins/markup_fmt/
MIT License
91 stars 4 forks source link

Failed to parse Jinja attribute starts with interpolation #46

Closed g-plane closed 3 weeks ago

g-plane commented 4 weeks ago

This seems to cause an issue for the following snippet that is not parsing anymore:

<picture
    {% for key, val in attributes.items %} 
        {{ key }}="{{ val }}"
    {% endfor %}
></picture>

I get this Failed to parse "src/t.html" with error Syntax(SyntaxError { kind: ExpectJinjaTag, pos: 61, line: 3, column: 11 }). This is failing to parse {{ key }} because it expect a JinjaTag.

_Originally posted by @UnknownPlatypus in https://github.com/g-plane/markup_fmt/issues/44#issuecomment-2305455805_

UnknownPlatypus commented 3 weeks ago

Thanks :raised_hands: