Run new topic through parser when it is updated

Fixes #584
This commit is contained in:
Pavel Djundik 2016-01-16 19:11:14 +02:00
parent 2f5b1663d7
commit a9344c1ade

View File

@ -342,9 +342,8 @@ $(function() {
}); });
socket.on("topic", function(data) { 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"); 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 // .attr() is safe escape-wise but consider the capabilities of the attribute
topic.attr("title", data.topic); topic.attr("title", data.topic);
}); });