trivago / melody

Melody is a library for building JavaScript web applications.
https://melody.js.org
Apache License 2.0
215 stars 39 forks source link

Allow tags in attributes #169

Open Khartir opened 3 years ago

Khartir commented 3 years ago

Explain the problem

Currently the parser does not allow tags in attributes. Valid Twig-Code like <option {% if disabled %}disabled{% endif %}> is not possible.

Expected Behaviour

Allow valid tags in attributes.

This came up in the prettier-plugin: https://github.com/trivago/prettier-plugin-twig-melody/issues/37

Is there a reason for this limitation or this is simply something that has not been implemented yet?

andyexeter commented 2 years ago

We're currently getting hit by the same issue, it'd be great to know if there are plans to support this at some point :)

As another example, this is failing for us in our base template:

<meta name="description" content="{% block meta_description %}{% endblock %}">
grzegorzgit commented 10 months ago

Why would this cause a problem? It is most normal and most common thing in the twig files. How can twig formatter failing on this? Seriously?