Эх сурвалжийг харах

Replace ReplaceAll(…) with Replace(…, -1)

This allows people to build the bridge with Go 1.11, the current version
in Debian stable.
Willem Mulder 5 жил өмнө
parent
commit
041c257e7a
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      portal.go

+ 1 - 1
portal.go

@@ -1177,7 +1177,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)