diff --git a/src/static/js/chat.js b/src/static/js/chat.js index ca488fe5f..f438ebfff 100755 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -193,7 +193,10 @@ var chat = (function() if(!chatOpen && ctx.duration > 0) { $.gritter.add({ - text: '
' + ctx.text, + // Note: ctx.authorName and ctx.text are already HTML-escaped. + text: $('')
+ .append($('').addClass('author-name').html(ctx.authorName))
+ .append(ctx.text),
sticky: ctx.sticky,
time: 5000,
position: 'bottom',
diff --git a/src/static/js/gritter.js b/src/static/js/gritter.js
index e6bb20842..64295ef70 100644
--- a/src/static/js/gritter.js
+++ b/src/static/js/gritter.js
@@ -11,7 +11,8 @@
* Edited by Sebastian Castro ').html(text) : text);
+ .append(typeof text === 'string' ? $(' ').text(text) : text);
// If it's false, don't show another gritter message
if(this['_before_open_' + number]() === false){