diff --git a/CHANGELOG.md b/CHANGELOG.md index bd234221f..a7c39cec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ # NHS.UK frontend Changelog -## Unreleased +## 9.2.0 - 12 February 2025 :new: **New features** +- Adds `text` param for Inset text ([PR 1113](https://github.com/nhsuk/nhsuk-frontend/pull/1113)) - Make it easier to set checkbox and radio checked items ([PR 1105](https://github.com/nhsuk/nhsuk-frontend/pull/1105)) -## 9.2.0 - 12 February 2025 - :wrench: **Fixes** - Fix appearance of the select element for more consistency between browsers and OS ([Issue 527](https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/527)) diff --git a/packages/components/inset-text/README.md b/packages/components/inset-text/README.md index fabc14d62..a0753fe51 100644 --- a/packages/components/inset-text/README.md +++ b/packages/components/inset-text/README.md @@ -35,7 +35,8 @@ The inset text Nunjucks macro takes the following arguments: | Name | Type | Required | Description | | -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------- | -| **html** | string | Yes | HTML content to be used within the inset text component. | +| **html** | string | No | HTML content to be used within the inset text component. | +| **text** | string | No | Text content to be used within the inset text component. | | **classes** | string | No | Optional additional classes to add to the inset text container. Separate each class with a space. | | **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the inset text container. | diff --git a/packages/components/inset-text/template.njk b/packages/components/inset-text/template.njk index 0eb0427ad..fe39e048f 100644 --- a/packages/components/inset-text/template.njk +++ b/packages/components/inset-text/template.njk @@ -5,5 +5,9 @@ {{- nhsukAttributes(params.attributes) }}> Information: {# params.HTML supported for backwards compatibility - see issue #950 #} - {{ (params.html or params.HTML) | safe }} + {% if params.html or params.HTML -%} + {{ (params.html or params.HTML) | safe | trim | indent(2) }} + {%- else %} +
{{ params.text }}
+ {% endif %}