Permalink
Browse files

Merge pull request #113 from KevinTraver/master

All titles should now return as single line.
  • Loading branch information...
2 parents c5564e7 + c1b3d69 commit 8b0d9dadf61e38db0d9e93c0ee1dca5c617f0fc0 @atmos atmos committed Nov 8, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 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

0 comments on commit 8b0d9da

Please sign in to comment.