{% from "../../macros/i18n.njk" import govukI18nAttributes %} {%- macro _accordionItem(params, item, index) %} {%- set headingLevel = params.headingLevel if params.headingLevel else 2 %}
{{ item.heading.html | safe | trim | indent(8) if item.heading.html else item.heading.text }} {% if item.summary.html or item.summary.text %}
{{ item.summary.html | safe | trim | indent(8) if item.summary.html else item.summary.text }}
{% endif %}
{% if item.content.html %} {{ item.content.html | safe | trim | indent(6) }} {% elif item.content.text %}

{{ item.content.text | trim | indent(8) }}

{% endif %}
{% endmacro -%}
{% for item in params.items %} {% if item %}{{ _accordionItem(params, item, loop.index) }}{% endif %} {% endfor %}