From 7da1555c847edfc5a1d75b1ed26362901d3f9609 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 21 Apr 2018 20:19:43 +0300 Subject: Improve Markdown rendering * Remove paragraphs from output HTML * Remove mention link wrapper from text (leaving only mention name) --- ui/room-view.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ui/room-view.go') 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. -- cgit v1.2.3