From ec72b62c0bd36ab43c32d2c22051565ac987c3dd Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Thu, 5 Oct 2023 15:52:13 -0700 Subject: [PATCH] feat: add rich urls --- src/lib/components/input/Link.svelte | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/lib/components/input/Link.svelte b/src/lib/components/input/Link.svelte index 3f790ef8..0edf1c7b 100644 --- a/src/lib/components/input/Link.svelte +++ b/src/lib/components/input/Link.svelte @@ -10,6 +10,8 @@ return undefined } } + + $: richURL = parseURL(href) @@ -18,10 +20,26 @@ + {#if richURL} + + {richURL.protocol}// + + + {richURL.hostname} + + + {richURL.pathname} + + {:else} {href} + {/if}