aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-21 20:19:43 +0300
committerTulir Asokan <tulir@maunium.net>2018-04-21 21:24:07 +0300
commit7da1555c847edfc5a1d75b1ed26362901d3f9609 (patch)
treeb21543c9c3e93ee607e7702a7c5b8fba32efbb1b /ui
parentd147fc7579bf77bf6f3ace669c8ade68be89d1ca (diff)
Improve Markdown rendering
* Remove paragraphs from output HTML * Remove mention link wrapper from text (leaving only mention name)
Diffstat (limited to 'ui')
-rw-r--r--ui/room-view.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/room-view.go b/ui/room-view.go
index 332605b..a66b0ee 100644
--- a/ui/room-view.go
+++ b/ui/room-view.go
@@ -242,10 +242,7 @@ type completion struct {
}
func (view *RoomView) AutocompleteUser(existingText string) (completions []completion) {
- textWithoutPrefix := existingText
- if strings.HasPrefix(existingText, "@") {
- textWithoutPrefix = existingText[1:]
- }
+ textWithoutPrefix := strings.TrimPrefix(existingText, "@")
for _, user := range view.Room.GetMembers() {
if user.DisplayName == textWithoutPrefix || user.UserID == existingText {
// Exact match, return that.