From ec8bbd2187e9e908beaaabdd190695d270749e45 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 16 Jul 2022 14:45:13 -0700 Subject: [PATCH] update formatting function to better account for indenting (#1541) --- jrnl/output.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jrnl/output.py b/jrnl/output.py index 78a1da24..78765ca9 100644 --- a/jrnl/output.py +++ b/jrnl/output.py @@ -89,5 +89,9 @@ def _add_extra_style_args_if_needed(args, msg): def format_msg_text(msg: Message) -> Text: - text = textwrap.dedent(msg.text.value.format(**msg.params)).strip() + text = textwrap.dedent(msg.text.value) + text = text.format(**msg.params) + # dedent again in case inserted text needs it + text = textwrap.dedent(text) + text = text.strip() return Text(text)