File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -223,12 +223,19 @@ async function runCodeInline() {
223223
224224 pyodide . setStdout ( {
225225 batched : ( text ) => {
226+ console . log ( '=== STDOUT BATCH ===' ) ;
227+ console . log ( 'Raw text:' , JSON . stringify ( text ) ) ;
228+
226229 fullOutput += text ;
227230
231+ console . log ( 'Full output so far:' , JSON . stringify ( fullOutput ) ) ;
232+
228233 // First, add \n after any \r that isn't already followed by \n
229234 // This ensures tqdm completion moves to new line
230235 let fixed = fullOutput . replace ( / \r (? ! \n ) / g, '\r\n' ) ;
231236
237+ console . log ( 'After fixing \\r:' , JSON . stringify ( fixed ) ) ;
238+
232239 // Now split by \n and process
233240 const lines = fixed . split ( '\n' ) ;
234241 const cleanLines = [ ] ;
@@ -249,6 +256,8 @@ async function runCodeInline() {
249256 }
250257 }
251258
259+ console . log ( 'Clean lines:' , cleanLines ) ;
260+
252261 output . innerHTML = `<pre style="margin: 0; color: #d4d4d4; white-space: pre-wrap;">${ escapeHtml ( cleanLines . join ( '\n' ) ) } </pre>` ;
253262 }
254263 } ) ;
You can’t perform that action at this time.
0 commit comments