Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Escape help commands in the right places. Fixes #343

  • Loading branch information...
commit 91d75738708a1236b47c3876a40a89f221a5d522 1 parent 5ac9004
@technicalpickles technicalpickles authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/scripts/help.coffee
View
7 src/scripts/help.coffee
@@ -52,8 +52,7 @@ helpContents = (name, commands) ->
module.exports = (robot) ->
robot.respond /help\s*(.*)?$/i, (msg) ->
- cmds = robot.helpCommands().map (cmd) ->
- cmd.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')
+ cmds = robot.helpCommands()
if msg.match[1]
cmds = cmds.filter (cmd) ->
@@ -67,7 +66,9 @@ module.exports = (robot) ->
msg.send emit
robot.router.get '/hubot/help', (req, res) ->
- cmds = robot.helpCommands()
+ cmds = robot.helpCommands().map (cmd) ->
+ cmd.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')
+
emit = "<p>#{cmds.join '</p><p>'}</p>"
emit = emit.replace /hubot/ig, "<b>#{robot.name}</b>"
Please sign in to comment.
Something went wrong with that request. Please try again.