From 96348254efb8e2ee17d597994ded663b5b036ade Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 16 Dec 2020 16:29:46 +0100 Subject: [PATCH] In web client, get rid of matchAll, unsupported in older browsers. --- rogue_chat.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rogue_chat.html b/rogue_chat.html index c685581..b9673a1 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -986,10 +986,11 @@ let tui = { }; inner_links[y].push([url_start_x, end_x, url]); }; - const matches = msg.matchAll(/https?:\/\/[^\s]+/g) let link_data = {}; let url_ends = []; - for (const match of matches) { + const regexp = RegExp('https?://[^\\s]+', 'g'); + let match; + while ((match = regexp.exec(msg)) !== null) { const url = match[0]; const url_start = match.index; const url_end = match.index + match[0].length; -- 2.30.2