diff options
Diffstat (limited to 'src/view/lib/strings.ts')
-rw-r--r-- | src/view/lib/strings.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/view/lib/strings.ts b/src/view/lib/strings.ts index b12fbd398..84ee07f37 100644 --- a/src/view/lib/strings.ts +++ b/src/view/lib/strings.ts @@ -140,3 +140,12 @@ export function toNiceDomain(url: string): string { return url } } + +export function toShareUrl(url: string) { + if (!url.startsWith('https')) { + const urlp = new URL('https://bsky.app') + urlp.pathname = url + url = urlp.toString() + } + return url +} |