diff --git a/bridge/zulip/zulip.go b/bridge/zulip/zulip.go index cdf433af..c7d81a33 100644 --- a/bridge/zulip/zulip.go +++ b/bridge/zulip/zulip.go @@ -7,6 +7,7 @@ import ( "strings" "sync" "time" + "regexp" "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" @@ -63,6 +64,10 @@ func (b *Bzulip) Send(msg config.Message) (string, error) { return "", err } + // Strip IRC colors sent to Zulip + re := regexp.MustCompile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`) + msg.Text = re.ReplaceAllString(msg.Text, "") + // Upload a file if it exists if msg.Extra != nil { for _, rmsg := range helper.HandleExtra(&msg, b.General) {