From 666e249413e561059e0ed1922a1f2324eeaf7ca9 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Wed, 4 Mar 2026 22:04:12 +0100 Subject: [PATCH] Revert "strip unicode bidi control characters in `cleanup_code` (#6649)" (#6672) --- redbot/core/dev_commands.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/redbot/core/dev_commands.py b/redbot/core/dev_commands.py index d67769662..d0e400f2c 100644 --- a/redbot/core/dev_commands.py +++ b/redbot/core/dev_commands.py @@ -42,18 +42,6 @@ _ = Translator("Dev", __file__) # - or "```" and potentially also strip a single "\n" if it follows it immediately START_CODE_BLOCK_RE = re.compile(r"^((```[\w.+\-]+\n+(?!```))|(```\n*))") -REMOVE_CONTROL_CHARS = [ - "\u2066", - "\u2067", - "\u2068", - "\u202A", - "\u202B", - "\u202D", - "\u202E", - "\u2069", - "\u202C", -] - T = TypeVar("T") @@ -87,8 +75,6 @@ async def maybe_await(coro: Union[T, Awaitable[T], Awaitable[Awaitable[T]]]) -> def cleanup_code(content: str) -> str: """Automatically removes code blocks from the code.""" - content = content.strip("".join(REMOVE_CONTROL_CHARS)) - # remove ```py\n``` if content.startswith("```") and content.endswith("```"): return START_CODE_BLOCK_RE.sub("", content)[:-3].rstrip("\n")