melody icon indicating copy to clipboard operation
melody copied to clipboard

Allow tags in attributes

Open Khartir opened this issue 4 years ago • 2 comments

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?

Khartir avatar Feb 19 '21 12:02 Khartir

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 %}">

andyexeter avatar Feb 08 '22 08:02 andyexeter

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?

grzegorzgit avatar Nov 01 '23 11:11 grzegorzgit