Skip to content

Commit

Permalink
fix internal links showing up as external pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok committed Mar 6, 2024
1 parent c08fcbc commit aa6f8a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/strings/url-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ export function feedUriToHref(url: string): string {
export function linkRequiresWarning(uri: string, label: string) {
const labelDomain = labelToDomain(label)

// If the uri started with a / we know it is internal.
if (uri.startsWith('/')) {
return false
}

let urip
try {
urip = new URL(uri)
} catch {
// If the uri started with a / we know it is internal.
if (uri.startsWith('/')) {
return false
}

return true
}

Expand Down

0 comments on commit aa6f8a0

Please sign in to comment.