3
0
mirror of https://github.com/42wim/matterbridge.git synced 2024-12-21 10:32:35 +01:00

Allowed Slack bridge to extract simpler link format. ()

Links sometimes exist without bar delimiters.

See: https://api.slack.com/docs/message-formatting#linking_to_urls
This commit is contained in:
Patrick Connolly 2017-10-26 15:58:43 -04:00 committed by Wim
parent 95a0229aaf
commit 76aafe1fa8

View File

@ -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)
}