autocomplete: fix usernames not being highlighted in @mentions.

Fix usernames not being highlighted when completing @mentions.

This also changes it so the autocomplete results don't include the '@'
in front of the name.

Minor breaking change to the /autocomplete.json API. Autocomplete
results for mentions now have the type `mention` instead of `user`.
This commit is contained in:
evazion
2022-09-03 19:10:58 -05:00
parent 03c02ef78e
commit f83af31a00
2 changed files with 4 additions and 2 deletions

View File

@@ -362,7 +362,7 @@ class AutocompleteService
# @return [Array<Hash>] the autocomplete results
def autocomplete_mention(string)
autocomplete_user(string).map do |result|
{ **result, value: "@" + result[:value] }
{ **result, type: "mention", value: "@" + result[:value] }
end
end