{% import 'components/macros/anchor.macro.twig' as anchor %}
{% set tags = node.tags
    |filter((v, k) => k not in ['var', 'param', 'property', 'property-read', 'property-write', 'method', 'return', 'package', 'api', 'deprecated'])
    |filter(seriesOfTag => seriesOfTag|length > 0) %}

{% if tags|length > 0 %}
    <h5 class="phpdocumentor-tag-list__heading" id="{{ anchor.for_element(node, 'tags') }}">
        Tags
        {{ include('components/headerlink.html.twig', {'on': node, 'at': 'tags'}, with_context = false) }}
    </h5>
    <dl class="phpdocumentor-tag-list">
        {% for name, seriesOfTag in tags %}
            <dt class="phpdocumentor-tag-list__entry">
                <span class="phpdocumentor-tag__name">{{ name }}</span>
            </dt>
            {% for tag in seriesOfTag %}
                <dd class="phpdocumentor-tag-list__definition">
                    {% if tag.version %}
                        <span class="phpdocumentor-tag-link">{{ tag.version }}</span>
                    {% endif %}
                    {% if tag.type %}
                        <span class="phpdocumentor-tag-link">{{ tag.type|route('class:short')|join('|')|raw }}</span>
                    {% endif %}
                    {% if tag.reference %}
                        <span class="phpdocumentor-tag-link">{{ tag.reference|route('class:short')|join('|')|raw }}</span>
                    {% endif %}
                    {% if tag.link %}
                        <a class="phpdocumentor-tag-link" href="{{ tag.link }}">{% if not tag.description.empty %} {{ tag.description | description | markdown }} {% else %} {{ tag.link }} {% endif %}</a>
                    {% else %}
                        {{ include('components/description.html.twig', {'node': tag}) }}
                    {% endif %}
                </dd>
            {% endfor %}
        {% endfor %}
    </dl>
{% endif %}
