Merge pull request #118 from 14mRh4X0r/support-go-1-11

Replace ReplaceAll(…) with Replace(…, -1)
This commit is contained in:
Tulir Asokan 2019-12-31 21:26:31 +02:00 committed by GitHub
commit e4ddc43007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1180,7 +1180,7 @@ func (portal *Portal) addRelaybotFormat(user *User, evt *mautrix.Event) bool {
}
if evt.Content.Format != mautrix.FormatHTML {
evt.Content.FormattedBody = strings.ReplaceAll(html.EscapeString(evt.Content.Body), "\n", "<br/>")
evt.Content.FormattedBody = strings.Replace(html.EscapeString(evt.Content.Body), "\n", "<br/>", -1)
evt.Content.Format = mautrix.FormatHTML
}
data, err := portal.bridge.Config.Bridge.Relaybot.FormatMessage(evt, member)