Skip to content
Myr

✏️ Fix typo in function name `_make_rich_text` (#959)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sofie Van Landeghem · committed by GitHub · parent 127d074 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:typer/rich_utils.py+6 added-6 removed
142 unmodified lines
143 stderr=stderr,144 )145146147def _make_rich_rext(147def _make_rich_text(148 *, text: str, style: str = "", markup_mode: MarkupMode149) -> Union[Markdown, Text]:150 """Take a string, remove indentations, and return styled text.151
41 unmodified lines
193 first_line = help_text.split("\n\n")[0]194 # Remove single linebreaks195 if markup_mode != MARKUP_MODE_MARKDOWN and not first_line.startswith("\b"):196 first_line = first_line.replace("\n", " ")197 yield _make_rich_rext(197 yield _make_rich_text(198 text=first_line.strip(),199 style=STYLE_HELPTEXT_FIRST_LINE,200 markup_mode=markup_mode,201 )
14 unmodified lines
216 else:217 # Join with double linebreaks if markdown218 remaining_lines = "\n\n".join(remaining_paragraphs)219220 yield _make_rich_rext(220 yield _make_rich_text(221 text=remaining_lines,222 style=STYLE_HELPTEXT,223 markup_mode=markup_mode,224 )
46 unmodified lines
271 else "{}\n".format(x.strip("\b\n"))272 for x in paragraphs273 ]274 items.append(275 _make_rich_rext(275 _make_rich_text(276 text="\n".join(paragraphs).strip(),277 style=STYLE_OPTION_HELP,278 markup_mode=markup_mode,279 )
50 unmodified lines
330 if markup_mode != MARKUP_MODE_RICH and not paragraphs[0].startswith("\b"):331 paragraphs[0] = paragraphs[0].replace("\n", " ")332 elif paragraphs[0].startswith("\b"):333 paragraphs[0] = paragraphs[0].replace("\b\n", "")334 return _make_rich_rext(334 return _make_rich_text(335 text=paragraphs[0].strip(),336 style=STYLE_OPTION_HELP,337 markup_mode=markup_mode,338 )
334 unmodified lines
673 if obj.epilog:674 # Remove single linebreaks, replace double with single675 lines = obj.epilog.split("\n\n")676 epilogue = "\n".join([x.replace("\n", " ").strip() for x in lines])677 epilogue_text = _make_rich_rext(text=epilogue, markup_mode=markup_mode)677 epilogue_text = _make_rich_text(text=epilogue, markup_mode=markup_mode)678 console.print(Padding(Align(epilogue_text, pad=False), 1))679680681def rich_format_error(self: click.ClickException) -> None:
30 unmodified lines