mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-06-07 13:43:31 +02:00
@@ -41,6 +41,10 @@ export default (socket) => {
|
|||||||
return `<span class="color-${color}">${msg}</span>`;
|
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
|
// send line back to the client
|
||||||
socket.emit('bot:message', buffer);
|
socket.emit('bot:message', buffer);
|
||||||
|
|
||||||
|
|||||||
@@ -102,3 +102,12 @@ body {
|
|||||||
.color-7 { color: #9A9A9A; }
|
.color-7 { color: #9A9A9A; }
|
||||||
.color-8 { color: #43443E; }
|
.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