update deps; experiment: log security
This commit is contained in:
6
vendor/maunium.net/go/mautrix/event/message.go
generated
vendored
6
vendor/maunium.net/go/mautrix/event/message.go
generated
vendored
@@ -138,9 +138,13 @@ func (content *MessageEventContent) SetEdit(original id.EventID) {
|
||||
}
|
||||
}
|
||||
|
||||
func TextToHTML(text string) string {
|
||||
return strings.ReplaceAll(html.EscapeString(text), "\n", "<br/>")
|
||||
}
|
||||
|
||||
func (content *MessageEventContent) EnsureHasHTML() {
|
||||
if len(content.FormattedBody) == 0 || content.Format != FormatHTML {
|
||||
content.FormattedBody = strings.ReplaceAll(html.EscapeString(content.Body), "\n", "<br/>")
|
||||
content.FormattedBody = TextToHTML(content.Body)
|
||||
content.Format = FormatHTML
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user