{"action":"created","issue":{"url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/42","labels_url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/42/comments","events_url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/42/events","html_url":"https://github.com/stevenosloan/slack-notifier/issues/42","id":111510758,"number":42,"title":"Format URLs as Slack links","user":{"login":"technicalpickles","id":159,"avatar_url":"https://avatars.githubusercontent.com/u/159?v=3","gravatar_id":"","url":"https://api.github.com/users/technicalpickles","html_url":"https://github.com/technicalpickles","followers_url":"https://api.github.com/users/technicalpickles/followers","following_url":"https://api.github.com/users/technicalpickles/following{/other_user}","gists_url":"https://api.github.com/users/technicalpickles/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalpickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalpickles/subscriptions","organizations_url":"https://api.github.com/users/technicalpickles/orgs","repos_url":"https://api.github.com/users/technicalpickles/repos","events_url":"https://api.github.com/users/technicalpickles/events{/privacy}","received_events_url":"https://api.github.com/users/technicalpickles/received_events","type":"User","site_admin":true},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-14T22:52:21Z","updated_at":"2015-10-15T17:20:26Z","closed_at":null,"body":"If you want to send URLs in Slack, you need to [format them](https://api.slack.com/docs/formatting) as such so they are clickable. Without that, they are just plain text.\r\n\r\n`LinkFormatter` already does markdown and html links, so that is a logical place to put it. I've been trying to figure out how to do this, but the hard part is that you need to regex to match the URL but *not* match an html or markdown link that's been converted already.\r\n\r\nI've found that you can use `  uri_regexp = URI.regexp(['http', 'https'])` to get a uri regexp. I'm not sure if this includes fragments though, ie `#` on the end."},"comment":{"url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/comments/148463723","html_url":"https://github.com/stevenosloan/slack-notifier/issues/42#issuecomment-148463723","issue_url":"https://api.github.com/repos/stevenosloan/slack-notifier/issues/42","id":148463723,"user":{"login":"technicalpickles","id":159,"avatar_url":"https://avatars.githubusercontent.com/u/159?v=3","gravatar_id":"","url":"https://api.github.com/users/technicalpickles","html_url":"https://github.com/technicalpickles","followers_url":"https://api.github.com/users/technicalpickles/followers","following_url":"https://api.github.com/users/technicalpickles/following{/other_user}","gists_url":"https://api.github.com/users/technicalpickles/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalpickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalpickles/subscriptions","organizations_url":"https://api.github.com/users/technicalpickles/orgs","repos_url":"https://api.github.com/users/technicalpickles/repos","events_url":"https://api.github.com/users/technicalpickles/events{/privacy}","received_events_url":"https://api.github.com/users/technicalpickles/received_events","type":"User","site_admin":true},"created_at":"2015-10-15T17:20:26Z","updated_at":"2015-10-15T17:20:26Z","body":"@stevenosloan I'm actually using `Slack::Notifier::LinkFormatter` on its own to format text for a Slack export (ie something that is compatible when you export a team, in order to import it). It's outside of the normal use case, so I'm okay with closing if it works as expected for notifying slack."}}