File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,15 @@ <h3>6. Manual CSS Processing</h3>
297
297
}
298
298
299
299
// Update custom properties status
300
+ function escapeHtml ( unsafe ) {
301
+ return unsafe
302
+ . replace ( / & / g, "&" )
303
+ . replace ( / < / g, "<" )
304
+ . replace ( / > / g, ">" )
305
+ . replace ( / " / g, """ )
306
+ . replace ( / ' / g, "'" ) ;
307
+ }
308
+
300
309
function updateCustomPropsStatus ( ) {
301
310
const statusEl = document . getElementById ( "custom-props-status" ) ;
302
311
const hasSupport = CSS . supports ( "--custom" , "value" ) ;
@@ -331,8 +340,8 @@ <h3>6. Manual CSS Processing</h3>
331
340
const outputCSS = CSSIfPolyfill . processCSSText ( inputCSS ) ;
332
341
333
342
outputEl . innerHTML = `
334
- <strong>Input:</strong> ${ inputCSS } <br>
335
- <strong>Output:</strong> ${ outputCSS }
343
+ <strong>Input:</strong> ${ escapeHtml ( inputCSS ) } <br>
344
+ <strong>Output:</strong> ${ escapeHtml ( outputCSS ) }
336
345
` ;
337
346
} ;
338
347
You can’t perform that action at this time.
0 commit comments