Skip to content

Commit

Permalink
Improve notebook output stream initialization (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Sep 26, 2024
1 parent fd184a5 commit b208786
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions javascript/src/ycell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,8 @@ export class YCodeCell
const { text, ...outputWithoutText } = output;
_newOutput1 = outputWithoutText;
const newText = new Y.Text();
let length = 0;
// text is a list of strings
for (const str of text as string[]) {
newText.insert(length, str);
length += str.length;
}
let _text = text instanceof Array ? text.join() : (text as string);
newText.insert(0, _text);
_newOutput1['text'] = newText;
} else {
_newOutput1 = output;
Expand Down

0 comments on commit b208786

Please sign in to comment.