slackhq/hubot-slack — pull request #129 by kballard (2014-12-18 01:08:56+00:00)
Title: Strip formatting better, use new SlackTextMessage class

Rewrite the `removeFormatting` method to remove formatting in a slightly
better way:
* Uses one pass instead of two for link handling
* Displays just the label instead of "#{link} #{label}" for regular
links with labels. I don't know why it was using both, that produces
weird output like

> apple.com http://apple.com

* Removes entities, which the old version didn't even try to handle

Add a new exported SlackTextMessage class that contains both the parsed
message (as @text) and the "raw" message (as @rawText). This provides an easy
way for scripts to detect that the message came from the Slack adapter and
handle the unparsed message if so desired.