FIX: strip html tags from category badge tooltips

This commit is contained in:
Neil Lalonde 2014-06-19 17:19:13 -04:00
parent cefdb98b79
commit eeeb834b6b

View file

@ -95,8 +95,9 @@ Discourse.HTML = {
(opts.clearChildColor ? ' clear-badge' : '') +
extraClasses + "\" ";
name = Handlebars.Utils.escapeExpression(name);
// Add description if we have it
if (description) html += "title=\"" + Handlebars.Utils.escapeExpression(description) + "\" ";
// Add description if we have it, without tags. Server has sanitized the description value.
if (description) html += "title=\"" + $("<div/>").html(description).text() + "\" ";
if (!opts.clearChildColor) {
var categoryStyle = Discourse.HTML.categoryStyle(category);