From 9f63ed049405bdcba698a9c1d9a709789c440ee5 Mon Sep 17 00:00:00 2001 From: Jason Slavin Date: Wed, 18 Dec 2024 09:58:53 -0800 Subject: [PATCH] Additive solution to keep localizeLink logic intact. Modified messaging on status --- libs/blocks/preflight/panels/seo.js | 4 ++-- libs/utils/utils.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/blocks/preflight/panels/seo.js b/libs/blocks/preflight/panels/seo.js index 322ea693fa..7e7a69dec4 100644 --- a/libs/blocks/preflight/panels/seo.js +++ b/libs/blocks/preflight/panels/seo.js @@ -238,10 +238,10 @@ async function checkLinks() { const badResults = []; links.forEach((link) => { - if (link.href.includes('http://')) { + if (link.dataset?.httpLink) { const httpLink = { url: link.href, - status: 'http in link', + status: 'authored as http', }; badResults.push(httpLink); } diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 13ecb1d7fb..130e129a25 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -680,6 +680,7 @@ export function decorateLinks(el) { const { hostname, href } = window.location; const links = [...anchors].reduce((rdx, a) => { appendHtmlToLink(a); + if (a.href.includes('http:')) a.setAttribute('data-http-link', 'true'); a.href = localizeLink(a.href); decorateSVG(a); if (a.href.includes('#_blank')) {