From b95bf21db3dc6226311e98fd7e0f0862d517a516 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 23 Jan 2026 22:46:57 -0800
Subject: refactor(lib): Migrate simple components to Svelte 5 runes syntax

---
 src/lib/MarkdownLink.svelte | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

(limited to 'src/lib/MarkdownLink.svelte')

diff --git a/src/lib/MarkdownLink.svelte b/src/lib/MarkdownLink.svelte
index 731eb263..ee8c4900 100644
--- a/src/lib/MarkdownLink.svelte
+++ b/src/lib/MarkdownLink.svelte
@@ -1,21 +1,20 @@
 <script lang="ts">
-  export let href: string;
-  export let text: string;
+  let { href, text }: { href: string; text: string } = $props();
+  let safeHref = $derived.by(() => {
+    try {
+      let url = new URL(href);
 
-  try {
-    let url = new URL(href);
+      switch (url.protocol) {
+        case 'javascript:':
+          return '#';
 
-    switch (url.protocol) {
-      case 'javascript:':
-        href = '#';
-        break;
-
-      default:
-        break;
+        default:
+          return href;
+      }
+    } catch (error) {
+      return '#';
     }
-  } catch (error) {
-    href = '#';
-  }
+  });
 </script>
 
-<a {href} target="_blank">{text}</a>
+<a href={safeHref} target="_blank">{text}</a>
-- 
cgit v1.2.3

