Skip to content
Permalink
Browse files

Thumbnail

  • Loading branch information...
Depado committed Dec 3, 2014
1 parent 154b0dc commit 9ea152b98e9c337158f47f28e3c0c964550f71d8
Showing with 6 additions and 1 deletion.
  1. +6 −1 app.js
7 app.js
@@ -56,7 +56,12 @@ io.sockets.on('connection', function (socket) {
var arr = data.split(" ");
for (var i=0; i<arr.length; i++) {
if (validUrl.isUri(arr[i])){
arr[i] = "<a href='" + arr[i] + "''>" + arr[i] + "</a>";
var re = new RegExp(/\.(jpeg|jpg|gif|png)$/);
if (arr[i].match(re)) {
arr[i] = "<img src='" + arr[i] + "' style='max-width: 200px; max-height=200px;' />"
} else {
arr[i] = "<a href='" + arr[i] + "''>" + arr[i] + "</a>";
}
}
}
data = arr.join(" ");

0 comments on commit 9ea152b

Please sign in to comment.
You can’t perform that action at this time.