Skip to content

Commit

Permalink
Indent HTML for Tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 13, 2024
1 parent 02c3478 commit f177bca
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/govuk-frontend/src/govuk/components/tabs/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
{% set tabPanelId = item.id if item.id else idPrefix + "-" + index -%}
<div class="govuk-tabs__panel {%- if index > 1 %} govuk-tabs__panel--hidden{% endif %}" id="{{ tabPanelId }}"
{{- govukAttributes(item.panel.attributes) }}>
{% if item.panel.html %}
{{ item.panel.html | safe }}
{% elif item.panel.text %}
<p class="govuk-body">{{ item.panel.text }}</p>
{% endif %}
{% if item.panel.html %}
{{ item.panel.html | safe | trim | indent(2) }}
{% elif item.panel.text %}
<p class="govuk-body">{{ item.panel.text }}</p>
{% endif %}
</div>
{% endmacro -%}

Expand All @@ -31,18 +31,18 @@
<h2 class="govuk-tabs__title">
{{ params.title | default ("Contents") }}
</h2>
{% if(params.items | length) %}
{% if params.items | length %}
<ul class="govuk-tabs__list">
{% for item in params.items %}
{% if item %}
{{- _tabListItem(params, item, loop.index) }}
{{- _tabListItem(params, item, loop.index) | trim | indent(4, true) }}
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% for item in params.items %}
{% if item %}
{{- _tabPanel(params, item, loop.index) }}
{{- _tabPanel(params, item, loop.index) | trim | indent(2, true) }}
{% endif %}
{% endfor %}
{% endif %}
</div>

0 comments on commit f177bca

Please sign in to comment.