Skip to content

Commit 2fb0f50

Browse files
committed
remove comments from HTML to be normalized, fixes final test
1 parent 143d0ea commit 2fb0f50

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

test/helpers.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ function cleanChildren(node) {
7575

7676
// recurse
7777
[...node.childNodes].forEach(child => {
78-
if (child.nodeType === 8) {
79-
// comment
80-
node.removeChild(child);
81-
return;
82-
}
83-
8478
if (child.nodeType === 3) {
8579
// text
8680
if (
@@ -123,6 +117,7 @@ export function normalizeHtml(window, html) {
123117
try {
124118
const node = window.document.createElement('div');
125119
node.innerHTML = html
120+
.replace(/<!--.*?-->/g, '')
126121
.replace(/>[\s\r\n]+</g, '><')
127122
.trim();
128123
cleanChildren(node, '');

0 commit comments

Comments
 (0)