aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-11-14 00:28:53 +0200
committerTulir Asokan <tulir@maunium.net>2018-11-14 00:28:53 +0200
commita0815a6f3de6ed4063fcdcf6c7af3f946bbf52f8 (patch)
treeecd06cea61855cd55371cc6adbd4e4674ce01755 /matrix
parent7651e84be949ecabac62d21b6e843b6776a2371e (diff)
Fix named colors and remove HTML from plaintext body when sending
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index cf9e463..54efd6e 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -21,6 +21,7 @@ import (
"fmt"
"io"
"io/ioutil"
+ "maunium.net/go/mautrix/format"
"net/http"
"net/url"
"os"
@@ -506,6 +507,9 @@ func (c *Container) SendMarkdownMessage(roomID string, msgtype mautrix.MessageTy
if html == text {
return c.SendMessage(roomID, msgtype, text)
}
+ // Oh god this is horrible
+ // but at least /rainbow doesn't put HTML into the plaintext :D
+ text = format.HTMLToText(html)
// Remove markdown link stuff from plaintext mentions and room links
text = mentionRegex.ReplaceAllString(text, "$1")