From ba93f4af2d41b6d7573344d45a948505054a9221 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Wed, 20 Apr 2022 17:14:30 -0400 Subject: [PATCH] fix: readd the Title to pep headers this was removed in python/peps#2532 --- monty/exts/info/pep.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monty/exts/info/pep.py b/monty/exts/info/pep.py index 48062b2b..2391425d 100644 --- a/monty/exts/info/pep.py +++ b/monty/exts/info/pep.py @@ -36,6 +36,11 @@ def parse(self, soup: BeautifulSoup) -> dict[str, str]: for dt in dl.find_all("dt"): results[dt.text] = dt.find_next_sibling("dd").text + # readd title to headers + # this was removed from the headers in python/peps#2532 + h1 = soup.find("h1", attrs={"class": "page-title"}) + results["Title"] = h1.text.split("-", 1)[-1] + return results