forked from slackapi/hubot-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request slackapi#125 from paulhammond/mailto-fix
Strip mailto: from mailto: links
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,14 +93,18 @@ describe 'Removing message formatting', -> | |
foo = slackbot.removeFormatting 'foo <https://www.example.com> bar' | ||
foo.should.equal 'foo https://www.example.com bar' | ||
|
||
it 'Should remove formatting around <mailto> links', -> | ||
foo = slackbot.removeFormatting 'foo <mailto:[email protected]> bar' | ||
foo.should.equal 'foo mailto:[email protected] bar' | ||
it 'Should remove formatting around <skype> links', -> | ||
foo = slackbot.removeFormatting 'foo <skype:echo123?call> bar' | ||
foo.should.equal 'foo skype:echo123?call bar' | ||
|
||
it 'Should remove formatting around <https> links with a label', -> | ||
foo = slackbot.removeFormatting 'foo <https://www.example.com|label> bar' | ||
foo.should.equal 'foo label https://www.example.com bar' | ||
|
||
it 'Should remove formatting around <mailto> links', -> | ||
foo = slackbot.removeFormatting 'foo <mailto:[email protected]> bar' | ||
foo.should.equal 'foo [email protected] bar' | ||
|
||
it 'Should change multiple links at once', -> | ||
foo = slackbot.removeFormatting 'foo <@U123|label> bar <#C123> <!channel> <https://www.example.com|label>' | ||
foo.should.equal 'foo label bar #general @channel label https://www.example.com' | ||
|