fix(components): use protocol-relative URLs

This commit is contained in:
Alan Ye 2025-04-06 00:40:52 +08:00
parent 896f5f8c53
commit c0d23af500
No known key found for this signature in database

View File

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