mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 00:09:41 +00:00
Merge pull request #339 from negue/chat_mentions
highlight the current username
This commit is contained in:
commit
5e594b3197
1 changed files with 5 additions and 0 deletions
|
|
@ -92,7 +92,12 @@
|
|||
scope.$watch(attrs.ngModel, function(value, oldValue) {
|
||||
var markdown = value;
|
||||
var linktarget = attrs.target || '_self';
|
||||
var userName = scope.User.user.profile.name;
|
||||
var userHighlight = "@"+userName;
|
||||
var html = md.toHtml(markdown);
|
||||
|
||||
html = html.replace(userHighlight, "<u>@"+userName+"</u>");
|
||||
|
||||
html = html.replace(' href','target="'+linktarget+'" href');
|
||||
element.html(html);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue