Improve Markdown rendering

* Remove paragraphs from output HTML
* Remove mention link wrapper from text (leaving only mention name)
This commit is contained in:
Tulir Asokan
2018-04-21 20:19:43 +03:00
parent d147fc7579
commit 7da1555c84
4 changed files with 71 additions and 5 deletions

View File

@ -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.