From 4bcdcd1ccd1d616d29614e5eaf8bfb1df679aa6d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 12 May 2019 17:34:47 +0300 Subject: Fix go 1.11 and go get compatibility --- ui/messages/html/parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/messages/html') diff --git a/ui/messages/html/parser.go b/ui/messages/html/parser.go index bc93e9d..a0757c4 100644 --- a/ui/messages/html/parser.go +++ b/ui/messages/html/parser.go @@ -323,7 +323,7 @@ func (parser *htmlParser) singleNodeToEntity(node *html.Node) Entity { switch node.Type { case html.TextNode: if !parser.keepLinebreak { - node.Data = strings.ReplaceAll(node.Data, "\n", "") + node.Data = strings.Replace(node.Data, "\n", "", -1) } if len(node.Data) == 0 { return nil @@ -385,7 +385,7 @@ const TabLength = 4 func Parse(room *rooms.Room, evt *mautrix.Event, senderDisplayname string) Entity { htmlData := evt.Content.FormattedBody if evt.Content.Format != mautrix.FormatHTML { - htmlData = strings.ReplaceAll(html.EscapeString(evt.Content.Body), "\n", "
") + htmlData = strings.Replace(html.EscapeString(evt.Content.Body), "\n", "
", -1) } htmlData = strings.Replace(htmlData, "\t", strings.Repeat(" ", TabLength), -1) -- cgit v1.2.3-70-g09d2