Replace tabs with spaces so that they get rendered
This commit is contained in:
parent
2a0145db88
commit
49cd74c548
@ -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{
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user