diff --git a/gateway/gateway.go b/gateway/gateway.go index 5dd735fa..c712f008 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -305,6 +305,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM // See: https://github.com/42wim/matterbridge/pull/512#issuecomment-428910199 text = regexp.MustCompile(`(:)([ $])`).ReplaceAllString(text, "ː$2") + // url + url_re := regexp.MustCompile(`(((http(s)?(\:\/\/))+(www\.)?([\w\-\.\/])*(\.[a-zA-Z]{2,3}\/?))[^\s\n|]*[^.,;:\?\!\@\^\$ -])`) + text = url_re.ReplaceAllString(text, "$0") + // @usernames results = regexp.MustCompile(`(@[a-zA-Z0-9-]+)`).FindAllStringSubmatch(text, -1) for _, r := range results {