Skip to content

Commit

Permalink
remove linebreaks so title display as one line
Browse files Browse the repository at this point in the history
  • Loading branch information
kevintraver committed Nov 8, 2011
1 parent 154d90b commit c1b3d69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/web.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit c1b3d69

Please sign in to comment.