Merge pull request #1083 from Armored-Dragon/fix/ArmoredChat-Link-Colors

Hard code link colors in Armored Chat
This commit is contained in:
ksuprynowicz 2024-07-16 23:17:35 +02:00 committed by GitHub
commit 673ccdf85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -510,7 +510,7 @@ Rectangle {
mess = mess.replace(arrow, "<");
var link = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
mess = mess.replace(link, (match) => {return "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a> <a onclick='Window.openUrl("+match+")'>⮺</a>"});
mess = mess.replace(link, (match) => {return `<a style="color:#4EBAFD" onclick='Window.openUrl("+match+")' href='` + match + `'>` + match + `</a> <a onclick='Window.openUrl(`+match+`)'></a>`});
var newline = /\n/gi;
mess = mess.replace(newline, "<br>");