Skip to content

Commit d5acc8a

Browse files
committed
Added escaping in VirtualComments.
1 parent 7e2cf5c commit d5acc8a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/query/VirtualComment.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
'../core',
33
'../var/trimRegExp',
44
'./var/dataIdAttr',
5-
'./VirtualElement'
6-
], function (blocks, trimRegExp, dataIdAttr, VirtualElement) {
5+
'./VirtualElement',
6+
'../modules/Escape'
7+
], function (blocks, trimRegExp, dataIdAttr, VirtualElement, Escape) {
78
function VirtualComment(commentText) {
89
if (!VirtualComment.prototype.isPrototypeOf(this)) {
910
return new VirtualComment(commentText);
@@ -27,7 +28,7 @@
2728
if (dataId) {
2829
html += dataId + ':';
2930
}
30-
html += this._commentText.replace(trimRegExp, '') + ' -->';
31+
html += Escape.forHTML(this._commentText.replace(trimRegExp, '')) + ' -->';
3132

3233
return html;
3334
},

0 commit comments

Comments
 (0)