From 803d30ed5f31a36368a3d73e18ba6c6f052f3c90 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 29 May 2025 13:44:46 +0200 Subject: [PATCH] f --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index d70707e..cde1537 100644 --- a/index.html +++ b/index.html @@ -67,11 +67,11 @@ const bannerStyle = banner.Style || {}; const imagePosition = bannerStyle.ImagePosition || 'right'; - // Process HTML content + // Process HTML content - unescape HTML entities const processHtml = (html) => { - const div = document.createElement('div'); - div.innerHTML = html; - return div.innerHTML; + const textarea = document.createElement('textarea'); + textarea.innerHTML = html; + return textarea.value; }; // Create main container @@ -126,7 +126,9 @@ `; const img = document.createElement('img'); - img.src = bannerImage.startsWith('http') ? bannerImage : `/${bannerImage}`; + // Fix image path - remove any leading slashes and add the correct base path + const cleanImagePath = bannerImage.replace(/^\/+/, ''); + img.src = bannerImage.startsWith('http') ? bannerImage : `/uploads/${cleanImagePath}`; img.alt = 'Banner image'; img.style.cssText = ` max-width: 100%;