File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,15 @@ function span(text) {
1313 return el
1414}
1515
16+ const escapeHTML = unsafe => {
17+ return unsafe
18+ . replaceAll ( "&" , "&" )
19+ . replaceAll ( "<" , "<" )
20+ . replaceAll ( ">" , ">" )
21+ . replaceAll ( '"' , """ )
22+ . replaceAll ( "'" , "'" )
23+ } ;
24+
1625const pointerLimit = Number . MAX_SAFE_INTEGER ;
1726let currentPointerID = 0 ;
1827
@@ -100,7 +109,7 @@ class PointerType {
100109 } else if ( this . value instanceof PointerType ) {
101110 value = span ( "(Pointer)" )
102111 } else {
103- value = this . value . toReporterContent ? this . value . toReporterContent ( ) : span ( this . value )
112+ value = this . value . toReporterContent ? this . value . toReporterContent ( ) : span ( typeof this . value == "string" ? escapeHTML ( this . value ) : this . value )
104113 }
105114 } catch ( e ) {
106115 value = span ( "(Recursive)" )
You can’t perform that action at this time.
0 commit comments