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>
297297 }
298298
299299 // 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+
300309 function updateCustomPropsStatus ( ) {
301310 const statusEl = document . getElementById ( "custom-props-status" ) ;
302311 const hasSupport = CSS . supports ( "--custom" , "value" ) ;
@@ -331,8 +340,8 @@ <h3>6. Manual CSS Processing</h3>
331340 const outputCSS = CSSIfPolyfill . processCSSText ( inputCSS ) ;
332341
333342 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 ) }
336345 ` ;
337346 } ;
338347
You can’t perform that action at this time.
0 commit comments