diff --git a/index.html b/index.html index 08c9c20..72f961f 100644 --- a/index.html +++ b/index.html @@ -131,6 +131,19 @@ const bannerTextContent = banner.Text || banner.text || ''; const bannerStyle = banner.Style || {}; + // Process the content to handle HTML tags + const processHtmlContent = (html) => { + // First decode HTML entities + const txt = document.createElement('textarea'); + txt.innerHTML = html; + const decoded = txt.value; + + // Then ensure proper HTML structure + const parser = new DOMParser(); + const doc = parser.parseFromString(decoded, 'text/html'); + return doc.body.innerHTML; + }; + // Create banner content let content = `
`; @@ -293,13 +308,6 @@ bannerContentEl.innerHTML = content; bannerContainer.style.display = 'block'; - // Decode HTML entities in the content - const htmlElements = bannerContentEl.getElementsByClassName('banner-html-content'); - if (htmlElements.length > 0) { - htmlElements[0].innerHTML = new DOMParser().parseFromString( - htmlElements[0].textContent, 'text/html').documentElement.textContent; - } - // Update the banner link if it exists if (bannerLinkValue) { let existingLink = bannerContainer.querySelector('a.banner-link');