From c0d23af50060dd7085c52cc6b35a32c08adea483 Mon Sep 17 00:00:00 2001 From: Alan Ye Date: Sun, 6 Apr 2025 00:40:52 +0800 Subject: [PATCH] fix(components): use protocol-relative URLs --- registry/lib/components/utils/active-video-links/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registry/lib/components/utils/active-video-links/index.ts b/registry/lib/components/utils/active-video-links/index.ts index efb5c3def..4934ea19c 100644 --- a/registry/lib/components/utils/active-video-links/index.ts +++ b/registry/lib/components/utils/active-video-links/index.ts @@ -48,7 +48,8 @@ const processDescLinks = () => { continue } - const link = matchText.includes('http') ? matchText : `http://${matchText}` + // Use protocol-relative URL with // instead of http:// or https:// + const link = matchText.startsWith('www.') ? `//${matchText}` : matchText.replace(/^https?:/, '') const replacement = `${matchText}` newContent =