From 41f496944b49f5e11295645e5ddc3fb1d56dc542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 2 Oct 2024 04:39:56 -0700 Subject: [PATCH] BUG: using rstrip to preserve indents (#637) --- myst_nb/core/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/myst_nb/core/utils.py b/myst_nb/core/utils.py index b3f428f5..68c6ea5b 100644 --- a/myst_nb/core/utils.py +++ b/myst_nb/core/utils.py @@ -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: