diff options
author | Patrick Connolly <patrick.c.connolly@gmail.com> | 2017-10-26 15:58:43 -0400 |
---|---|---|
committer | Wim <wim@42.be> | 2017-10-26 21:58:43 +0200 |
commit | 76aafe1fa81ea8d8339181042e72f07bcafcec58 (patch) | |
tree | 5c6ccf35361db7d5822398ae4a28c07b8355d9a9 /bridge/slack/slack.go | |
parent | 95a0229aaf3b108dbb78d6d45c0b42e1ee4822d6 (diff) | |
download | matterbridge-msglm-76aafe1fa81ea8d8339181042e72f07bcafcec58.tar.gz matterbridge-msglm-76aafe1fa81ea8d8339181042e72f07bcafcec58.tar.bz2 matterbridge-msglm-76aafe1fa81ea8d8339181042e72f07bcafcec58.zip |
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
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) } |