There was an error while loading. Please reload this page.
1 parent 37373a4 commit 3f21686Copy full SHA for 3f21686
1 file changed
script.js
@@ -231,10 +231,13 @@ async function runCodeInline() {
231
console.log('Full output so far:', JSON.stringify(fullOutput));
232
233
// First, add \n after any \r that isn't already followed by \n
234
- // This ensures tqdm completion moves to new line
235
let fixed = fullOutput.replace(/\r(?!\n)/g, '\r\n');
236
237
- console.log('After fixing \\r:', JSON.stringify(fixed));
+ // Special fix: detect end of tqdm (pattern like "it/s]") and add newline if not present
+ // This ensures content after tqdm appears on new line
238
+ fixed = fixed.replace(/(\d+\.\d+it\/s\])(?!\n)/g, '$1\n');
239
+
240
+ console.log('After fixing \\r and tqdm:', JSON.stringify(fixed));
241
242
// Now split by \n and process
243
const lines = fixed.split('\n');
0 commit comments