mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-18 20:33:28 +02:00
@@ -41,6 +41,10 @@ export default (socket) => {
|
||||
return `<span class="color-${color}">${msg}</span>`;
|
||||
});
|
||||
|
||||
buffer = buffer.replace(/((([A-Za-z]{3,9}:(?:\/\/))(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.))((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\-\.\!\/\\\w]*))?)/gi, (regex) => {
|
||||
return `<a href="${regex}" target="_blank">${regex}</a>`;
|
||||
});
|
||||
|
||||
// send line back to the client
|
||||
socket.emit('bot:message', buffer);
|
||||
|
||||
|
||||
+10
-1
@@ -101,4 +101,13 @@ body {
|
||||
.color-6 { color: #EF9B00; }
|
||||
.color-7 { color: #9A9A9A; }
|
||||
.color-8 { color: #43443E; }
|
||||
.color-9 { color: #412BFF; }
|
||||
.color-9 { color: #412BFF; }
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: inherit;
|
||||
}
|
||||
Reference in New Issue
Block a user