diff --git a/training-front-end/public/images/gsa-smartpay-training-logo.svg b/training-front-end/public/images/gsa-smartpay-training-logo.svg index 74cb53fe..db2a601a 100644 --- a/training-front-end/public/images/gsa-smartpay-training-logo.svg +++ b/training-front-end/public/images/gsa-smartpay-training-logo.svg @@ -1,4 +1,4 @@ diff --git a/training-front-end/public/js/uswds.js b/training-front-end/public/js/uswds.js index 8052650c..3a43b6c7 100644 --- a/training-front-end/public/js/uswds.js +++ b/training-front-end/public/js/uswds.js @@ -4388,11 +4388,31 @@ function toggleHtmlTag(isMobile) { if (!bigFooter) { return; } + function getSafeTagName(tagName) { + if (!tagName) { + return "div"; + } + const normalized = String(tagName).toLowerCase(); + const allowedTags = [ + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "button", + "div", + "span", + "a" + ]; + return allowedTags.indexOf(normalized) !== -1 ? normalized : "div"; + } const primaryLinks = bigFooter.querySelectorAll(BUTTON); primaryLinks.forEach(currentElement => { const currentElementClasses = currentElement.getAttribute("class"); - const preservedHtmlTag = currentElement.getAttribute("data-tag") || currentElement.tagName; - const newElementType = isMobile ? "button" : preservedHtmlTag; + // const preservedHtmlTag = currentElement.getAttribute("data-tag") || currentElement.tagName; + + const newElementType = isMobile ? "button" : getSafeTagName(preservedHtmlTag); // Create the new element const newElement = document.createElement(newElementType); diff --git a/training-front-end/src/assets/images/gsa-smartpay-training-logo.svg b/training-front-end/src/assets/images/gsa-smartpay-training-logo.svg index 74cb53fe..db2a601a 100644 --- a/training-front-end/src/assets/images/gsa-smartpay-training-logo.svg +++ b/training-front-end/src/assets/images/gsa-smartpay-training-logo.svg @@ -1,4 +1,4 @@ diff --git a/training-front-end/src/components/USAIdentifier.astro b/training-front-end/src/components/USAIdentifier.astro index ca4a93af..20bd7096 100644 --- a/training-front-end/src/components/USAIdentifier.astro +++ b/training-front-end/src/components/USAIdentifier.astro @@ -81,6 +81,18 @@ import gsa_logo from '../assets/images/gsa-logo.svg' >Privacy policy +