From e18aca5290ec41a512b75d5269695ee53b810877 Mon Sep 17 00:00:00 2001 From: npy11 Date: Tue, 1 Oct 2024 18:25:55 +0530 Subject: [PATCH] relative url added to table image src --- blocks/code/code.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blocks/code/code.js b/blocks/code/code.js index e1f9b2092a..f40b3201a7 100644 --- a/blocks/code/code.js +++ b/blocks/code/code.js @@ -16,5 +16,10 @@ export default async function decorate(block) { if (iframe.length != 0) { block.parentElement.classList.add('iframe-width'); } + // adding relative url to table image src + block.querySelectorAll('img').forEach((img)=>{ + let url = new URL(img.src); + img.src = url.pathname; + }); mobileHeaderAnalytics(block); } \ No newline at end of file