diff --git a/framework/core/js/forum/src/components/UsersSearchSource.js b/framework/core/js/forum/src/components/UsersSearchSource.js index f1b2d5222..0ea76e22c 100644 --- a/framework/core/js/forum/src/components/UsersSearchSource.js +++ b/framework/core/js/forum/src/components/UsersSearchSource.js @@ -1,5 +1,6 @@ import highlight from 'flarum/helpers/highlight'; import avatar from 'flarum/helpers/avatar'; +import username from 'flarum/helpers/username'; /** * The `UsersSearchSource` finds and displays user search results in the search @@ -23,14 +24,19 @@ export default class UsersSearchResults { return [
  • {app.translator.trans('core.forum.search.users_heading')}
  • , - results.map(user => ( -
  • - - {avatar(user)} - {highlight(user.username(), query)} - -
  • - )) + results.map(user => { + const name = username(user); + name.children[0] = highlight(name.children[0], query); + + return ( +
  • + + {avatar(user)} + {name} + +
  • + ); + }) ]; } }