Bogus 'closing tag matches nothing' warning

已回答

This valid TWIG file produces exactly what it's supposed to (in the application and in https://twigfiddle.com/), but for some reason PHPStorm is unable to figure out that the <a>...</a> tags are matched, and emits "⚠️ Closing tag matches nothing :5" in the Problems panel.

 

<div {{ attributes }}>
  <nav class="action-links">
  {% for action in actions %}
    {# Ignore 'Closing tag matches nothing' warning. It is bogus and there's no way to turn it off in PHPStorm. #}
    <a href="{{ action.url }}" class="button usa-button button-action"{% for name, value in action.attributes %} {{ name }}="{{ value }}"{% endfor %}>{{ action.label }}</a>
  {% endfor %}
  </nav>
</div>
0

That's a known issue: https://youtrack.jetbrains.com/issue/WI-12455 - please vote for it in order to get notified about its updates & increase its priority.

0

请先登录再写评论。