Core: Link improve external link detection by enabling it on any protocols

This commit is contained in:
Fuma Nama
2025-09-02 17:21:36 +08:00
parent 205d92d3a3
commit f65778d801
2 changed files with 9 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-core': patch
---
`Link` improve external link detection by enabling it on any protocols
+4 -5
View File
@@ -20,11 +20,10 @@ const Link = forwardRef<HTMLAnchorElement, LinkProps>(
(
{
href = '#',
external = !(
href.startsWith('/') ||
href.startsWith('#') ||
href.startsWith('.')
),
// any protocol
external = href.match(/^\w+:/) ||
// protocol relative URL
href.startsWith('//'),
prefetch,
...props
},