From d92d3c8a990730213430b686d239fc7b278530a9 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Wed, 8 Jul 2020 13:32:19 +0100 Subject: [PATCH] Switch hint from span to div It's possible to pass HTML into the hint component, but this becomes invalid HTML if someone passes a block element in (for example: a

tag) as the hint wraps everything in a span. This commit switches the hint from using a wrapping span to a div, so block elements can be passed in as valid HTML. --- src/govuk/components/hint/_index.scss | 4 ++-- src/govuk/components/hint/template.njk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/govuk/components/hint/_index.scss b/src/govuk/components/hint/_index.scss index 63932b639d..18a44da8d3 100644 --- a/src/govuk/components/hint/_index.scss +++ b/src/govuk/components/hint/_index.scss @@ -16,7 +16,7 @@ // is unlikely that the default or govuk-label--s class would be used in this // case. - // This adjustment will not work in browsers that do not support :not(). + // This adjustment will not work in browsers that do not support :not(). // Users with these browsers will see the default size margin (5px larger). .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-hint { @@ -30,7 +30,7 @@ // it is unlikely that the default or govuk-fieldset__legend--s class would be // used in this case. - // This adjustment will not work in browsers that do not support :not(). + // This adjustment will not work in browsers that do not support :not(). // Users with these browsers will see the default size margin (5px larger). .govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl) + .govuk-hint { diff --git a/src/govuk/components/hint/template.njk b/src/govuk/components/hint/template.njk index 58350dca06..f84fb51fc9 100644 --- a/src/govuk/components/hint/template.njk +++ b/src/govuk/components/hint/template.njk @@ -1,4 +1,4 @@ - {{ params.html | safe if params.html else params.text }} - +