aboutsummaryrefslogtreecommitdiff
path: root/ui/messages/parser/parser.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-07 23:21:11 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-07 23:21:11 +0300
commite5db799fa30c5e3c7290d7ead07c84ada11087ac (patch)
tree536f231aa79c6736a0dc9e721bc51d77719deb12 /ui/messages/parser/parser.go
parentb81ba7b631b5243bd61514db1787a3f9043990e0 (diff)
parent5d7c1a4caab46f7e981aed7b9cc825b7602b4098 (diff)
Merge branch 'deep-message-rendering'
Diffstat (limited to 'ui/messages/parser/parser.go')
-rw-r--r--ui/messages/parser/parser.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/messages/parser/parser.go b/ui/messages/parser/parser.go
index 79e628a..e48bd5f 100644
--- a/ui/messages/parser/parser.go
+++ b/ui/messages/parser/parser.go
@@ -113,7 +113,7 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *mautrix.Eve
replyToEvt.Content.FormattedBody = html.EscapeString(replyToEvt.Content.Body)
}
evt.Content.FormattedBody = fmt.Sprintf(
- "In reply to <a href='https://matrix.to/#/%[1]s'>%[1]s</a><blockquote>%[2]s</blockquote><br/>%[3]s",
+ "In reply to <a href='https://matrix.to/#/%[1]s'>%[1]s</a><blockquote>%[2]s</blockquote><br/><br/>%[3]s",
replyToEvt.Sender, replyToEvt.Content.FormattedBody, evt.Content.FormattedBody)
} else {
evt.Content.FormattedBody = fmt.Sprintf(
@@ -125,8 +125,7 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *mautrix.Eve
switch evt.Content.MsgType {
case "m.text", "m.notice", "m.emote":
if evt.Content.Format == mautrix.FormatHTML {
- text := ParseHTMLMessage(room, evt, displayname)
- return messages.NewExpandedTextMessage(evt.ID, evt.Sender, displayname, evt.Content.MsgType, text, ts)
+ return messages.NewHTMLMessage(evt.ID, evt.Sender, displayname, evt.Content.MsgType, ParseHTMLMessage(room, evt, displayname), ts)
}
evt.Content.Body = strings.Replace(evt.Content.Body, "\t", " ", -1)
return messages.NewTextMessage(evt.ID, evt.Sender, displayname, evt.Content.MsgType, evt.Content.Body, ts)