From 7d716a2d67ad13515b429e6615fc506dbab80caf Mon Sep 17 00:00:00 2001 From: GhOsT <79806064+Arman0334@users.noreply.github.com> Date: Sun, 6 Mar 2022 20:48:48 +0400 Subject: [PATCH] Fix formatting breaking with nested formatting utils in help (#5601) * Fix formatting breaking with nested formatters. * Remove useless f-strings * Revert formatting to the one before PR #5435 * One more small formatting revert Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> --- redbot/core/commands/help.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py index 840e8339c..0951cb7bb 100644 --- a/redbot/core/commands/help.py +++ b/redbot/core/commands/help.py @@ -401,9 +401,11 @@ class RedHelpFormatter(HelpFormatterABC): ) for i, page in enumerate(pagify(subtext, page_length=500, shorten_by=0)): if i == 0: - title = bold(underline(_("Subcommands:"))) + title = bold(underline(_("Subcommands:")), escape_formatting=False) else: - title = bold(underline(_("Subcommands: (continued)"))) + title = bold(underline(_("Subcommands:")), escape_formatting=False) + _( + " (continued)" + ) field = EmbedField(title, page, False) emb["fields"].append(field) @@ -576,9 +578,11 @@ class RedHelpFormatter(HelpFormatterABC): ) for i, page in enumerate(pagify(command_text, page_length=500, shorten_by=0)): if i == 0: - title = f"{underline(bold(_('Commands:')))}" + title = underline(bold(_("Commands:")), escape_formatting=False) else: - title = f"{underline(bold(_('Commands: (continued)')))}" + title = underline(bold(_("Commands:")), escape_formatting=False) + _( + " (continued)" + ) field = EmbedField(title, page, False) emb["fields"].append(field) @@ -628,9 +632,9 @@ class RedHelpFormatter(HelpFormatterABC): for cog_name, data in coms: if cog_name: - title = f"{underline(bold(cog_name))}:" + title = underline(bold(f"{cog_name}:"), escape_formatting=False) else: - title = f"{underline(bold(_('No Category:')))}" + title = underline(bold(_("No Category:")), escape_formatting=False) def shorten_line(a_line: str) -> str: if len(a_line) < 70: # embed max width needs to be lower