From 86d0a6f31b4a3b5861779d4a1e0e288c11938ab2 Mon Sep 17 00:00:00 2001 From: Scritches Date: Sat, 14 Apr 2018 13:38:28 -0400 Subject: [PATCH] Link module title regexp fix Fix for sites that use <\/title> instead of to close their title elements. --- 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 b400680..2d077ab 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)/gim, " "); - var title = body.valMatch(/(.*?)<\/title>/, 2); + var title = body.valMatch(/<title>(.*?)<\\?\/title>/, 2); if(title && title.length < 140) { callback(ent.decode(title[1]).trim()); }