Skip to content

Commit 3768575

Browse files
committed
MC-25219: Update messages mechanism
1 parent 113f816 commit 3768575

File tree

2 files changed

+12
-2
lines changed
  • app/code/Magento/Security/view/base/web/js
  • dev/tests/js/jasmine/tests/app/code/Magento/Security/view/base/web/js

2 files changed

+12
-2
lines changed

app/code/Magento/Security/view/base/web/js/escaper.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,16 @@ define([], function () {
8585
return NodeFilter.FILTER_ACCEPT;
8686
},
8787
false
88-
);
88+
),
89+
nodesToRemove = [];
8990

9091
while (treeWalker.nextNode()) {
91-
treeWalker.currentNode.parentNode.removeChild(treeWalker.currentNode);
92+
nodesToRemove.push(treeWalker.currentNode);
9293
}
94+
95+
nodesToRemove.forEach(function (nodeToRemove) {
96+
nodeToRemove.parentNode.removeChild(nodeToRemove);
97+
});
9398
},
9499

95100
/**

dev/tests/js/jasmine/tests/app/code/Magento/Security/view/base/web/js/escaper.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ define([
9797
expected: 'Only <span><b>2</b></span> in stock ',
9898
allowedTags: ['span', 'b']
9999
},
100+
'text with multiple comments': {
101+
data: 'Only <span><b>2</b></span> <!-- HTML COMMENT -->in stock <!-- HTML COMMENT -->',
102+
expected: 'Only <span><b>2</b></span> in stock ',
103+
allowedTags: ['span', 'b']
104+
},
100105
'text with multi-line html comment': {
101106
data: 'Only <span><b>2</b></span> in stock <!-- --!\n\n><img src=#>-->',
102107
expected: 'Only <span><b>2</b></span> in stock ',

0 commit comments

Comments
 (0)