✨ Make epilog formatting consistent with other parts of the help string - #1405
Conversation
travishathaway
left a comment
There was a problem hiding this comment.
I had a chance to read the original discussion and think this is a perfectly fine solution to this problem.
|
This looks like an elegant solution to the problem in my view, and also brings over some behaviour from the help description processing (mainly the usage of Great PR 🚀 I'll rebase my internal fork of typer and include these fixes until @tiangolo merges this PR. The last PR for an issue I was running into took about 1.5 years to get merged into typer master, so I'm hoping this one doesn't take quite that long 😅 |
This comment was marked as resolved.
This comment was marked as resolved.
|
@tiangolo can we get this pull-request merged? 🙏🏼 thank you! |
|
@tiangolo I'm aware you're very busy, but this is a really minor fix that will mean I can stop maintaining a separate fork of typer that includes this fix. If you could please merge this I would be most grateful 😄 |
As discussed in #1400, the formatting of the
epilogsection of the help text is currently not consistent with the other parts of the help text.This PR introduces a new private function
_fix_linebreaksthat has the same functionality as before as part of_get_help_text. It deals with linebreaks depending on the given markup mode. This function is then also used when printing the epilog, ensuring consistency. Only the formatting of the epilog is changed, nothing else.On
master, the new unit test fails both for "markdown" and "rich", as it joins together the first few lines into one big"Just wrapping up: This is the first conclusion Here is conclusion two"line.