Links are now clickable

Fixes #4
This commit is contained in:
AlexKvazos
2015-05-19 20:31:09 -05:00
parent 8817e25ad6
commit ff70870f0d
2 changed files with 14 additions and 1 deletions
+4
View File
@@ -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
View File
@@ -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;
}