From 76aafe1fa81ea8d8339181042e72f07bcafcec58 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 26 Oct 2017 15:58:43 -0400 Subject: [PATCH] Allowed Slack bridge to extract simpler link format. (#287) Links sometimes exist without bar delimiters. See: https://api.slack.com/docs/message-formatting#linking_to_urls --- bridge/slack/slack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 23f60277..2f708832 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -410,7 +410,7 @@ func (b *Bslack) replaceMention(text string) string { } func (b *Bslack) replaceURL(text string) string { - results := regexp.MustCompile(`<(.*?)\|.*?>`).FindAllStringSubmatch(text, -1) + results := regexp.MustCompile(`<(.*?)(\|.*?)?>`).FindAllStringSubmatch(text, -1) for _, r := range results { text = strings.Replace(text, r[0], r[1], -1) }