Skip to content

Commit

Permalink
Added escaping in VirtualComments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanaye committed Oct 3, 2016
1 parent 7e2cf5c commit d5acc8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/query/VirtualComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
'../core',
'../var/trimRegExp',
'./var/dataIdAttr',
'./VirtualElement'
], function (blocks, trimRegExp, dataIdAttr, VirtualElement) {
'./VirtualElement',
'../modules/Escape'
], function (blocks, trimRegExp, dataIdAttr, VirtualElement, Escape) {
function VirtualComment(commentText) {
if (!VirtualComment.prototype.isPrototypeOf(this)) {
return new VirtualComment(commentText);
Expand All @@ -27,7 +28,7 @@
if (dataId) {
html += dataId + ':';
}
html += this._commentText.replace(trimRegExp, '') + ' -->';
html += Escape.forHTML(this._commentText.replace(trimRegExp, '')) + ' -->';

return html;
},
Expand Down

0 comments on commit d5acc8a

Please sign in to comment.