fix(components): use protocol-relative URLs

This commit is contained in:
Alan Ye 2025-04-06 13:04:29 +08:00
parent c0d23af500
commit ec77980db8
No known key found for this signature in database

View File

@ -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 = `<a href='${link}' target='_blank'>${matchText}</a>`
newContent =