Skip to content

Commit

Permalink
Use rstrip over strip in coalesce_streams
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Sep 27, 2024
1 parent c2b76d8 commit 846a0c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions myst_nb/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def coalesce_streams(outputs: list[NotebookNode]) -> list[NotebookNode]:
for output in outputs:
if output["output_type"] == "stream":
if output["name"] in streams:
out = output["text"].strip()
out = output["text"].rstrip()
if out:
streams[output["name"]]["text"] += f"{out}\n"
else:
output["text"] = output["text"].strip() + "\n"
output["text"] = output["text"].rstrip() + "\n"
new_outputs.append(output)
streams[output["name"]] = output
else:
Expand Down

0 comments on commit 846a0c0

Please sign in to comment.