aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-12-08 12:22:23 +0100
committerGravatar GitHub <[email protected]>2021-12-08 12:22:23 +0100
commitd347632101df232c54e315b590afff31134d169d (patch)
tree1878df34a045c7044bbaf0a7435fc89e616e636d
parentMerge pull request #1996 from python-discord/snekbox-api-url-env-var (diff)
parentMerge branch 'main' into fix-pep-whitespace (diff)
Merge pull request #1994 from onerandomusername/fix-pep-whitespace
fix: parse whitespace out of pep titles
-rw-r--r--bot/exts/info/pep.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/exts/info/pep.py b/bot/exts/info/pep.py
index 8c0db18bc..67866620b 100644
--- a/bot/exts/info/pep.py
+++ b/bot/exts/info/pep.py
@@ -97,9 +97,12 @@ class PythonEnhancementProposals(Cog):
def generate_pep_embed(self, pep_header: Dict, pep_nr: int) -> Embed:
"""Generate PEP embed based on PEP headers data."""
+ # the parsed header can be wrapped to multiple lines, so we need to make sure that is removed
+ # for an example of a pep with this issue, see pep 500
+ title = " ".join(pep_header["Title"].split())
# Assemble the embed
pep_embed = Embed(
- title=f"**PEP {pep_nr} - {pep_header['Title']}**",
+ title=f"**PEP {pep_nr} - {title}**",
description=f"[Link]({BASE_PEP_URL}{pep_nr:04})",
)