update formatting function to better account for indenting (#1541)

This commit is contained in:
Jonathan Wren 2022-07-16 14:45:13 -07:00 committed by GitHub
parent e695180049
commit ec8bbd2187
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)