diff options
author | Steve Azzopardi <steveazz@outlook.com> | 2018-11-20 10:11:42 +0100 |
---|---|---|
committer | Steve Azzopardi <steveazz@outlook.com> | 2018-11-20 10:11:42 +0100 |
commit | 282a5b4c84b5b68a86f55a17e674d16b9a1a17cb (patch) | |
tree | baca3d1acd16800fd1a33a2df5434aba75bed431 /app/assets | |
parent | a0c86637c138a17a8ae136e4698cf192b5949c36 (diff) | |
parent | e35eeaf8afce6842e490f1386d3cdaaaf5f0126c (diff) | |
download | gitlab-ce-282a5b4c84b5b68a86f55a17e674d16b9a1a17cb.tar.gz |
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 00b3d283570..6f8b73564d0 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -151,10 +151,16 @@ class GfmAutoComplete { // Team Members $input.atwho({ at: '@', + alias: 'users', displayTpl(value) { let tmpl = GfmAutoComplete.Loading.template; - if (value.username != null) { - tmpl = GfmAutoComplete.Members.template; + const { avatarTag, username, title } = value; + if (username != null) { + tmpl = GfmAutoComplete.Members.templateFunction({ + avatarTag, + username, + title, + }); } return tmpl; }, @@ -565,8 +571,9 @@ GfmAutoComplete.Emoji = { }; // Team Members GfmAutoComplete.Members = { - // eslint-disable-next-line no-template-curly-in-string - template: '<li>${avatarTag} ${username} <small>${title}</small></li>', + templateFunction({ avatarTag, username, title }) { + return `<li>${avatarTag} ${username} <small>${_.escape(title)}</small></li>`; + }, }; GfmAutoComplete.Labels = { template: |