summaryrefslogtreecommitdiffstats
path: root/bridge/irc/irc.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-05-23 21:46:15 +0200
committerGitHub <noreply@github.com>2020-05-23 21:46:15 +0200
commitba0bfe70a8f07164e1341f4b094841acdad5c3a2 (patch)
tree1724d193854bc333b56cd585138ebe8a013dcbd8 /bridge/irc/irc.go
parent3c4a3e3f75bcab74539512eeab40cc88a9f849a2 (diff)
downloadmatterbridge-msglm-ba0bfe70a8f07164e1341f4b094841acdad5c3a2.tar.gz
matterbridge-msglm-ba0bfe70a8f07164e1341f4b094841acdad5c3a2.tar.bz2
matterbridge-msglm-ba0bfe70a8f07164e1341f4b094841acdad5c3a2.zip
Add StripMarkdown option (irc). (#1145)
Enable `StripMarkdown` to strip markdown for irc.
Diffstat (limited to 'bridge/irc/irc.go')
-rw-r--r--bridge/irc/irc.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index bae9aef0..5fc315a7 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -14,6 +14,7 @@ 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
@@ -156,6 +157,10 @@ 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 {