Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make “it’s a trap” work with a proper apostrophe #1325

Merged
merged 2 commits into from

2 participants

@meowgorithm

slack.com has a habit of auto-converting ' into ’

@meowgorithm meowgorithm Make “it’s a trap” work with a proper apostrophe
Slack has a habit of auto-converting ' into ’
ed5816d
src/scripts/ackbar.coffee
@@ -36,5 +36,5 @@ ackbars = [
]
module.exports = (robot) ->
- robot.hear /it'?s a trap\b/i, (msg) ->
+ robot.hear /it('|’)?s a trap\b/i, (msg) ->
@technicalpickles Owner

This would probably be better as a character group, ie:

robot.hear /it['`]?s a trap\b/i, (msg) ->

That would avoid making it a capture group too.

Good call. I'll update. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@meowgorithm

Okay, updated the “it’s a trap” pattern

@technicalpickles technicalpickles merged commit 0e1de18 into github:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 12, 2014
  1. @meowgorithm

    Make “it’s a trap” work with a proper apostrophe

    meowgorithm authored
    Slack has a habit of auto-converting ' into ’
  2. @meowgorithm
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/scripts/ackbar.coffee
View
2  src/scripts/ackbar.coffee
@@ -36,5 +36,5 @@ ackbars = [
]
module.exports = (robot) ->
- robot.hear /it'?s a trap\b/i, (msg) ->
+ robot.hear /it['’]?s a trap\b/i, (msg) ->
msg.send msg.random ackbars
Something went wrong with that request. Please try again.