diff --git a/libs/blocks/hero-marquee/hero-marquee.js b/libs/blocks/hero-marquee/hero-marquee.js index 77f55809e7..1ccaeb9b56 100644 --- a/libs/blocks/hero-marquee/hero-marquee.js +++ b/libs/blocks/hero-marquee/hero-marquee.js @@ -85,6 +85,12 @@ function decorateBg(el) { el.remove(); } +function wrapInnerHTMLInPTag(el) { + const innerDiv = el.querySelector(':scope > div'); + const containsPTag = [...innerDiv.childNodes].some((node) => node.nodeName === 'P'); + if (!containsPTag) innerDiv.innerHTML = `
${innerDiv.innerHTML}
`; +} + function decorateText(el, classes) { el.classList.add('norm'); const btnClass = classes?.find((c) => c.endsWith('-button')); @@ -95,6 +101,7 @@ function decorateText(el, classes) { } else { decorateButtons(el, 'button-xl'); } + wrapInnerHTMLInPTag(el); decorateBlockText(el, textDefault); decorateTextOverrides(el, ['-heading', '-body', '-detail']); }