diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-11-14 00:28:53 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-11-14 00:28:53 +0200 |
commit | a0815a6f3de6ed4063fcdcf6c7af3f946bbf52f8 (patch) | |
tree | ecd06cea61855cd55371cc6adbd4e4674ce01755 /matrix | |
parent | 7651e84be949ecabac62d21b6e843b6776a2371e (diff) |
Fix named colors and remove HTML from plaintext body when sending
Diffstat (limited to 'matrix')
-rw-r--r-- | matrix/matrix.go | 4 |
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") |