update formatting function to better account for indenting

This commit is contained in:
Jonathan Wren 2022-07-16 13:58:11 -07:00
parent ca1f2a76d8
commit 36f349b200

View file

@ -89,5 +89,9 @@ def _add_extra_style_args_if_needed(args, msg):
def format_msg_text(msg: Message) -> Text: 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) return Text(text)