File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,6 +174,12 @@ async function attachListeners() {
174174 document . querySelector ( ".compile-tooltip-text" ) . textContent = shortcutText ;
175175}
176176
177+ function escapeHtml ( text ) {
178+ const div = document . createElement ( "div" ) ;
179+ div . textContent = text ;
180+ return div . innerHTML ;
181+ }
182+
177183function displayCompileErrors ( errs ) {
178184 if ( monacoEditor ) {
179185 const model = monacoEditor . getModel ( ) ;
@@ -226,7 +232,7 @@ function displayCompileErrors(errs) {
226232 }
227233 let errContent = "" ;
228234 for ( const err of errs ) {
229- errContent += `<div class="editor-errors-line">${ err . errmsg } </div>` ;
235+ errContent += `<div class="editor-errors-line">${ escapeHtml ( err . errmsg ) } </div>` ;
230236 }
231237 const displayEl = document . getElementById ( "editor-errors" ) ;
232238 displayEl . innerHTML = errContent ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments