From e34b46d4e4ff3953d6658a2e798a283581293fe4 Mon Sep 17 00:00:00 2001 From: kabniel Date: Wed, 21 Aug 2013 19:24:04 +0200 Subject: [PATCH] Update link.js change title regex to be non-greedy --- modules/link/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index ab0e156..7051f05 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -27,7 +27,7 @@ var link = function(dbot) { page = request(link.replace('https', 'http'), function(error, response, body) { if(!error && response.statusCode == 200) { body = body.replace(/(\r\n|\n\r|\n)/gm, " "); - var title = body.valMatch(/(.*)<\/title>/, 2); + var title = body.valMatch(/<title>(.*?)<\/title>/, 2); if(title && title.length < 140) { callback(ent.decode(title[1]).trim()); }