about summary refs log tree commit diff
path: root/src/view/lib/strings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/lib/strings.ts')
-rw-r--r--src/view/lib/strings.ts9
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
+}