Add backtick to HTML escape code

Internet Explorer treats a backtick (`) as an attribute
delimiter like " and '. Account for this in HTML escape
code.

Change-Id: I48bccc0013829662479ce321a34f5c69e48aca95
This commit is contained in:
Andrew Bonventre
2016-02-16 17:52:23 -05:00
parent b7defbdd5d
commit d171f07a78

View File

@@ -30,11 +30,12 @@ util.htmlEntityMap = {
'>': '>', '>': '>',
'"': '"', '"': '"',
'\'': ''', '\'': ''',
'/': '/' '/': '/',
'`': '`',
}; };
util.escapeHTML = function(str) { util.escapeHTML = function(str) {
return str.replace(/[&<>"'\/]/g, function(s) { return str.replace(/[&<>"'`\/]/g, function(s) {
return util.htmlEntityMap[s]; return util.htmlEntityMap[s];
}); });
}; };