From fdd71946da62877f00d605f8967a05ae2a8f663c Mon Sep 17 00:00:00 2001
From: Zed <zedeus@pm.me>
Date: Thu, 15 Aug 2019 18:45:56 +0200
Subject: [PATCH] Fix empty link replacement

---
 src/formatters.nim | 5 +++--
 src/prefs.nim      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/formatters.nim b/src/formatters.nim
index 4a268c0..920301c 100644
--- a/src/formatters.nim
+++ b/src/formatters.nim
@@ -63,10 +63,11 @@ proc linkifyText*(text: string; prefs: Prefs): string =
     result = result.replace(twRegex, prefs.replaceTwitter)
 
 proc replaceUrl*(url: string; prefs: Prefs): string =
+  result = url
   if prefs.replaceYouTube.len > 0:
-    return url.replace(ytRegex, prefs.replaceYouTube)
+    result = url.replace(ytRegex, prefs.replaceYouTube)
   if prefs.replaceTwitter.len > 0:
-    return url.replace(twRegex, prefs.replaceTwitter)
+    result = url.replace(twRegex, prefs.replaceTwitter)
 
 proc stripTwitterUrls*(text: string): string =
   result = text
diff --git a/src/prefs.nim b/src/prefs.nim
index d73977b..f383860 100644
--- a/src/prefs.nim
+++ b/src/prefs.nim
@@ -44,7 +44,7 @@ const prefList*: Table[string, seq[Pref]] = {
          defaultState: false),
 
     Pref(kind: checkbox, name: "autoplayGifs", label: "Autoplay gifs",
-         defaultState: true),
+         defaultState: true)
   ],
 
   "Display": @[