Skip to content

Commit

Permalink
Merge pull request #1113 from nhsuk/inset-text-text
Browse files Browse the repository at this point in the history
Add support for text param for Inset text
  • Loading branch information
anandamaryon1 authored Feb 12, 2025
2 parents 42dcf6a + 12c4765 commit 22da3ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
3 changes: 2 additions & 1 deletion packages/components/inset-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

Expand Down
6 changes: 5 additions & 1 deletion packages/components/inset-text/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
{{- nhsukAttributes(params.attributes) }}>
<span class="nhsuk-u-visually-hidden">Information: </span>
{# 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 %}
<p>{{ params.text }}</p>
{% endif %}
</div>

0 comments on commit 22da3ed

Please sign in to comment.