aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-05-12 17:34:47 +0300
committerTulir Asokan <tulir@maunium.net>2019-05-12 17:34:47 +0300
commit4bcdcd1ccd1d616d29614e5eaf8bfb1df679aa6d (patch)
tree0b8eb608ea4d592ea2a1ab06ba77254e75dd0148 /ui
parentbedbc3d10a87146bba4cc37c356068ef8849a496 (diff)
Fix go 1.11 and go get compatibility
Diffstat (limited to 'ui')
-rw-r--r--ui/messages/html/parser.go4
-rw-r--r--ui/messages/htmlmessage.go2
2 files changed, 3 insertions, 3 deletions
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", "<br/>")
+ htmlData = strings.Replace(html.EscapeString(evt.Content.Body), "\n", "<br/>", -1)
}
htmlData = strings.Replace(htmlData, "\t", strings.Repeat(" ", TabLength), -1)
diff --git a/ui/messages/htmlmessage.go b/ui/messages/htmlmessage.go
index 9777303..30b1588 100644
--- a/ui/messages/htmlmessage.go
+++ b/ui/messages/htmlmessage.go
@@ -106,5 +106,5 @@ func (hw *HTMLMessage) String() string {
return fmt.Sprintf("&messages.HTMLMessage{\n" +
" Base=%s,\n" +
" Root=||\n%s\n" +
- "}", strings.ReplaceAll(hw.BaseMessage.String(), "\n", "\n "), hw.Root.String())
+ "}", strings.Replace(hw.BaseMessage.String(), "\n", "\n ", -1), hw.Root.String())
}