mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-09 23:40:27 +00:00
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
This commit is contained in:
parent
95a0229aaf
commit
76aafe1fa8
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user