From 4486ded2281c7f9e827c447744fde72ea1d4d14e Mon Sep 17 00:00:00 2001 From: timkim Date: Tue, 13 Jan 2026 14:05:53 -0800 Subject: [PATCH] fix: fix localhost images --- hlx_statics/scripts/scripts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hlx_statics/scripts/scripts.js b/hlx_statics/scripts/scripts.js index ef22b41a3..4bd87e051 100644 --- a/hlx_statics/scripts/scripts.js +++ b/hlx_statics/scripts/scripts.js @@ -872,7 +872,8 @@ function fixLocalDev(document){ if(isLocalHostEnvironment(window.location.host)){ // replace all images with eds div structure document.querySelectorAll('img').forEach((img) => { - if(img.src.includes('raw.githubusercontent.com')) { + // Check for both GitHub raw URLs AND localhost URLs + if(img.src.includes('raw.githubusercontent.com') || img.src.includes('127.0.0.1:3003') || img.src.includes('localhost:3003')) { const lastDotIndex = img.src.lastIndexOf('.'); let imageExtension = ''; if (lastDotIndex !== -1) { @@ -890,6 +891,7 @@ function fixLocalDev(document){ }); } } + async function loadPage() { fixLocalDev(document); await loadEager(document);