File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ function clean_children(node, opts) {
2626 } ) ;
2727
2828 attributes . forEach ( ( attr ) => {
29+ // Strip out the special onload/onerror hydration events from the test output
2930 if ( ( attr . name === 'onload' || attr . name === 'onerror' ) && attr . value === 'this.__e=event' ) {
3031 return ;
3132 }
@@ -67,6 +68,7 @@ function clean_children(node, opts) {
6768 continue ;
6869 }
6970
71+ // add newlines for better readability and potentially recurse into children
7072 if ( child . nodeType === 1 || child . nodeType === 8 ) {
7173 if ( previous ?. nodeType === 3 ) {
7274 const prev = /** @type {Text } */ ( previous ) ;
@@ -95,6 +97,7 @@ function clean_children(node, opts) {
9597 text . data = text . data . trimEnd ( ) ;
9698 }
9799
100+ // indent code for better readability
98101 if ( has_element_children && node . parentNode ) {
99102 node . innerHTML = `\n\ ${ node . innerHTML . replace ( / \n / g, '\n ' ) } \n` ;
100103 }
You can’t perform that action at this time.
0 commit comments