Skip to content

Commit dd6987c

Browse files
committed
Fix stream output
1 parent 5de54c8 commit dd6987c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jupyter_ydoc/ynotebook.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ def create_ycell(self, value: Dict[str, Any]) -> Map:
166166
outputs = cell.get("outputs", [])
167167
for idx, output in enumerate(outputs):
168168
if output.get("output_type") == "stream":
169-
output["text"] = Array(output.get("text", []))
169+
text = output.get("text", "")
170+
if isinstance(text, str):
171+
ytext = Text(text)
172+
else:
173+
ytext = Text("".join(text))
174+
output["text"] = ytext
170175
outputs[idx] = Map(output)
171176
cell["outputs"] = Array(outputs)
172177
cell["execution_state"] = "idle"

0 commit comments

Comments
 (0)