highlight the current username

This commit is contained in:
Negue
2014-10-15 20:12:54 +02:00
parent 11761f9ee2
commit 4698ab81a1
+5
View File
@@ -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);
});