Skip to content

Commit

Permalink
Use utility method for escaping text when generating reply fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jun 23, 2023
1 parent 77f7e00 commit 1d9b6a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions event/reply.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"regexp"
"strings"

"golang.org/x/net/html"

"maunium.net/go/mautrix/id"
)

Expand Down Expand Up @@ -59,7 +57,7 @@ func (evt *Event) GenerateReplyFallbackHTML() string {
parsedContent.RemoveReplyFallback()
body := parsedContent.FormattedBody
if len(body) == 0 {
body = strings.ReplaceAll(html.EscapeString(parsedContent.Body), "\n", "<br/>")
body = TextToHTML(parsedContent.Body)
}

senderDisplayName := evt.Sender
Expand Down

0 comments on commit 1d9b6a4

Please sign in to comment.