{% if params.html or params.text %}
{% set labelHtml %}
<label class="govuk-label{%- if params.classes %} {{ params.classes }}{% endif %}"
  {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
  {%- if params.for %} for="{{ params.for }}"{% endif %}>
  {{ params.html | safe if params.html else params.text }}
</label>
{% endset %}

{% if params.isPageHeading %}
<h1 class="govuk-label-wrapper">{{ labelHtml | safe | indent(2) }}</h1>
{% else %}
{{ labelHtml | safe }}
{% endif %}
{% endif %}
