From bda603eca7d8271796e9e51e9cfc09ba3deed295 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 4 Sep 2020 18:19:55 +0300 Subject: [PATCH] Fix extra newline in plaintext body when sending code block. Fixes #216 --- go.mod | 2 +- go.sum | 4 ++-- ui/room-view.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1c4847e..3048822 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/vansante/go-ffprobe.v2 v2.0.2 gopkg.in/yaml.v2 v2.3.0 - maunium.net/go/mautrix v0.7.5 + maunium.net/go/mautrix v0.7.6 maunium.net/go/mauview v0.1.1 maunium.net/go/tcell v0.2.0 ) diff --git a/go.sum b/go.sum index c4e30cc..4572c2b 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,8 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= maunium.net/go/maulogger/v2 v2.1.1/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A= -maunium.net/go/mautrix v0.7.5 h1:3MFayZGekrPVL0xogwqeX50UdQnKqGkd9w1c1HQoyYo= -maunium.net/go/mautrix v0.7.5/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= +maunium.net/go/mautrix v0.7.6 h1:jB9oCimPq0mVyolwQBC/9N1fu21AU+Ryq837cLf4gOo= +maunium.net/go/mautrix v0.7.6/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY= maunium.net/go/mauview v0.1.1/go.mod h1:3QBUiuLct9moP1LgDhCGIg0Ovxn38Bd2sGndnUOuj4o= maunium.net/go/tcell v0.2.0 h1:1Q0kN3wCOGAIGu1r3QHADsjSUOPDylKREvCv3EzJpVg= diff --git a/ui/room-view.go b/ui/room-view.go index 654f11a..8c8d2be 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -440,6 +440,7 @@ func (view *RoomView) SetEditing(evt *muksevt.Event) { // This feels kind of dangerous, but I think it works msgContent = view.editing.Gomuks.Edits[len(view.editing.Gomuks.Edits)-1].Content.AsMessage().NewContent } + // TODO this should parse HTML instead of just using the plaintext body text := msgContent.Body if msgContent.MsgType == event.MsgEmote { text = "/me " + text