Skip to content

Commit

Permalink
fix internal links showing up as external (#3128)
Browse files Browse the repository at this point in the history
* fix internal links showing up as external

* fix internal links showing up as external
  • Loading branch information
haileyok authored Mar 6, 2024
1 parent 2d9a5db commit 4e6020b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/strings/url-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ export function linkRequiresWarning(uri: string, label: string) {
const host = urip.hostname.toLowerCase()

// Hosts that end with bsky.app or bsky.social should be trusted by default.
if (host.endsWith('bsky.app') || host.endsWith('bsky.social')) {
if (
uri.startsWith('/') ||
host.endsWith('bsky.app') ||
host.endsWith('bsky.social') ||
host.endsWith('blueskyweb.xyz')
) {
// if this is a link to internal content,
// warn if it represents itself as a URL to another app
return !!labelDomain && labelDomain !== host && isPossiblyAUrl(labelDomain)
Expand Down

0 comments on commit 4e6020b

Please sign in to comment.