From aca7ee454a58648c8747bb94feff10b93c2ee4e2 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Fri, 27 Nov 2020 03:16:01 +0100
Subject: [PATCH] Fix minor link formatting bug.

---
 rogue_chat.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rogue_chat.html b/rogue_chat.html
index 74d3a2e..3818254 100644
--- a/rogue_chat.html
+++ b/rogue_chat.html
@@ -814,6 +814,10 @@ let tui = {
               if (in_link) {
                   push_inner_link(y, chunk.length);
                   url_start_x = 0;
+                  if (url_ends[0] == i) {
+                      in_link = false;
+                      url_ends.shift();
+                  }
               };
               lines.push(chunk);
               chunk = "";
@@ -830,7 +834,8 @@ let tui = {
               url_start_x = x;
               url = link_data[i];
               in_link = true;
-          } else if (url_ends.includes(i)) {
+          } else if (url_ends[0] == i) {
+              url_ends.shift();
               push_inner_link(y, x);
               in_link = false;
           }
-- 
2.30.2