diff options
Diffstat (limited to 'ui/messages/parser')
-rw-r--r-- | ui/messages/parser/htmlparser.go | 1 | ||||
-rw-r--r-- | ui/messages/parser/parser.go | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/ui/messages/parser/htmlparser.go b/ui/messages/parser/htmlparser.go index 8577ee7..cd268a5 100644 --- a/ui/messages/parser/htmlparser.go +++ b/ui/messages/parser/htmlparser.go @@ -180,6 +180,7 @@ func (parser *MatrixHTMLProcessor) Postprocess() { // ParseHTMLMessage parses a HTML-formatted Matrix event into a UIMessage. func ParseHTMLMessage(room *rooms.Room, evt *gomatrix.Event, senderDisplayname string) tstring.TString { htmlData, _ := evt.Content["formatted_body"].(string) + htmlData = strings.Replace(htmlData, "\t", " ", -1) msgtype, _ := evt.Content["msgtype"].(string) processor := &MatrixHTMLProcessor{ diff --git a/ui/messages/parser/parser.go b/ui/messages/parser/parser.go index b114d98..eef91a2 100644 --- a/ui/messages/parser/parser.go +++ b/ui/messages/parser/parser.go @@ -18,6 +18,7 @@ package parser import ( "fmt" + "strings" "time" "maunium.net/go/gomatrix" @@ -64,6 +65,7 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *gomatrix.Ev return messages.NewExpandedTextMessage(evt.ID, evt.Sender, displayname, msgtype, text, ts) } text, _ := evt.Content["body"].(string) + text = strings.Replace(text, "\t", " ", -1) return messages.NewTextMessage(evt.ID, evt.Sender, displayname, msgtype, text, ts) case "m.image": url, _ := evt.Content["url"].(string) |