Merge pull request #587 from xPaw/patch-3

Run new topic through parser when it is updated
This commit is contained in:
Mattias Erming 2016-01-24 15:47:29 +01:00
commit 0f4209733f
1 changed files with 1 additions and 2 deletions

View File

@ -364,9 +364,8 @@ $(function() {
});
socket.on("topic", function(data) {
// .text() escapes HTML but not quotes. That only matters with text inside attributes.
var topic = $("#chan-" + data.chan).find(".header .topic");
topic.text(data.topic);
topic.html(Handlebars.helpers.parse(data.topic));
// .attr() is safe escape-wise but consider the capabilities of the attribute
topic.attr("title", data.topic);
});