From c1b3d69dfd8f12aa54459a19e6fc1db83ba97cc7 Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Tue, 8 Nov 2011 10:03:51 -0900 Subject: [PATCH] remove linebreaks so title display as one line --- src/scripts/web.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/web.coffee b/src/scripts/web.coffee index 57157d608..9a8d1566c 100644 --- a/src/scripts/web.coffee +++ b/src/scripts/web.coffee @@ -21,11 +21,11 @@ module.exports = (robot) -> parser.parseComplete body results = (Select handler.dom, "head title") if results[0] - msg.send results[0].children[0].data + msg.send results[0].children[0].data.replace(/(\r\n|\n|\r)/gm,"") else results = (Select handler.dom, "title") if results[0] - msg.send results[0].children[0].data + msg.send results[0].children[0].data.replace(/(\r\n|\n|\r)/gm,"") else msg.send "Error " + res.statusCode @@ -39,7 +39,7 @@ module.exports = (robot) -> format: "json" .get() (err, res, body) -> response = JSON.parse body - responseTitle = response.data.info[0].title + responseTitle = response.data.info[0].title.replace(/(\r\n|\n|\r)/gm,"") if responseTitle msg.send if response.status_code is 200 then responseTitle else response.status_txt else