From a0815a6f3de6ed4063fcdcf6c7af3f946bbf52f8 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 14 Nov 2018 00:28:53 +0200 Subject: Fix named colors and remove HTML from plaintext body when sending --- matrix/matrix.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'matrix') 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") -- cgit v1.2.3