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