commit a73b95bc3a69a44dcb4e474df810b6f9a37060f7
Author: Wim <wim@42.be>
Date: Sat May 23 21:46:15 2020 +0000
diff --git a/bridge/config/config.go b/bridge/config/config.go
index 031f5a8..59d7d4b 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -1366 +1367 @@ type Protocol struct {
SkipTLSVerify bool // IRC, mattermost
SkipVersionCheck bool // mattermost
StripNick bool // all protocols
+ StripMarkdown bool // irc
SyncTopic bool // slack
TengoModifyMessage string // general
Team string // mattermost, keybase
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index bae9aef..5fc315a 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -146 +147 @@ import (
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/bridge/helper"
"github.com/lrstanley/girc"
+ stripmd "github.com/writeas/go-strip-markdown"
// We need to import the 'data' package as an implicit dependency.
// See: https://godoc.org/github.com/paulrosania/go-charset/charset
@@ -1566 +15710 @@ func (b *Birc) Send(msg config.Message) (string, error) {
}
var msgLines []string
+ if b.GetBool("StripMarkdown") {
+ msg.Text = stripmd.Strip(msg.Text)
+ }
+
if b.GetBool("MessageSplit") {
msgLines = helper.GetSubLines(msg.Text, b.MessageLength)
} else {
diff --git a/go.mod b/go.mod
index c2433d0..e7378bc 100644
--- a/go.mod
+++ b/go.mod
@@ -496 +497 @@ require (
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.4.0
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
+ github.com/writeas/go-strip-markdown v2.0.1+incompatible
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
github.com/yaegashi/msgraph.go v0.1.2
github.com/zfjagann/golang-ring v0.0.0-20190106091943-a88bb6aef447
@@ -566 +577 @@ require (
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
+ github.com/writeas/go-strip-markdown v2.0.1+incompatible
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
)
diff --git a/go.sum b/go.sum
index b983d8c..52b7c7f 100644
--- a/go.sum
+++ b/go.sum
@@ -2506 +2508 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4=
github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
+github.com/writeas/go-strip-markdown v2.0.1+incompatible h1:IIqxTM5Jr7RzhigcL6FkrCNfXkvbR+Nbu1ls48pXYcw=
+github.com/writeas/go-strip-markdown v2.0.1+incompatible/go.mod h1:Rsyu10ZhbEK9pXdk8V6MVnZmTzRG0alMNLMwa0J01fE=
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample
index e0942c6..975078c 100644
--- a/matterbridge.toml.sample
+++ b/matterbridge.toml.sample
@@ -1036 +10310 @@ ColorNicks=false
#OPTIONAL (default empty)
RunCommands=["PRIVMSG user hello","PRIVMSG chanserv something"]
+#StripMarkdown strips markdown from messages
+#OPTIONAL (default false)
+StripMarkdown=false
+
#Nicks you want to ignore.
#Regular expressions supported
#Messages from those users will not be sent to other bridges.