Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inset-text not supporting html param #951

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Removing classes from icon card that are not doing anything
- Align label bottom margins with fieldset legend bottom margins ([PR 946](https://github.com/nhsuk/nhsuk-frontend/pull/946)).
- Fixed bug with inset-text component requiring uppercase `html` argument. Fixes [Issue 950](https://github.com/nhsuk/nhsuk-frontend/issues/950).

## 8.1.1 - 14 March 2024

Expand Down
2 changes: 1 addition & 1 deletion app/components/inset-text/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ insetText({
"HTML": "<p>You can report any suspected side effect to the <a href=\"https://yellowcard.mhra.gov.uk/\" title=\"External website\">UK safety scheme</a>.</p>"
"html": "<p>You can report any suspected side effect to the <a href=\"https://yellowcard.mhra.gov.uk/\" title=\"External website\">UK safety scheme</a>.</p>"
}) }}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/inset-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
{% from 'components/inset-text/macro.njk' import insetText %}

{{ insetText({
"HTML": "<p>You can report any suspected side effect to the <a href=\"https://yellowcard.mhra.gov.uk/\" title=\"External website\">UK safety scheme</a>.</p>"
"html": "<p>You can report any suspected side effect to the <a href=\"https://yellowcard.mhra.gov.uk/\" title=\"External website\">UK safety scheme</a>.</p>"
}) }}
```

Expand All @@ -35,7 +35,7 @@ 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 | Yes | HTML 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
3 changes: 2 additions & 1 deletion packages/components/inset-text/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
{%- if params.classes %} {{ params.classes }}{% endif %}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
<span class="nhsuk-u-visually-hidden">Information: </span>
{{ params.HTML | safe }}
{# params.HTML supported for backwards compatibility - remove in future? #}
{{ (params.html or params.HTML) | safe }}
</div>
Loading