From: Christian Heller Date: Wed, 16 Dec 2020 15:29:46 +0000 (+0100) Subject: In web client, get rid of matchAll, unsupported in older browsers. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/templates?a=commitdiff_plain;h=96348254efb8e2ee17d597994ded663b5b036ade;p=plomrogue2 In web client, get rid of matchAll, unsupported in older browsers. --- 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;