Skip to content

Commit 4ee0594

Browse files
committed
apply patch from @AA-Turner
Signed-off-by: William Woodruff <[email protected]>
1 parent 1def89a commit 4ee0594

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pep_sphinx_extensions/generate_rss.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,17 @@ def pep_abstract(document: nodes.document) -> str:
5353
"""Return the first paragraph of the PEP abstract.
5454
If not found, return the first paragraph of the introduction.
5555
"""
56-
introduction = ""
5756
for node in document.findall(nodes.section):
5857
title_node = node.next_node(nodes.title)
5958
if title_node is None:
6059
continue
6160

62-
para_node = None
63-
if title_node.astext() == "Abstract":
61+
if title_node.astext() in {"Abstract", "Introduction"}:
6462
para_node = node.next_node(nodes.paragraph)
65-
elif title_node.astext() == "Introduction":
66-
para_node = node.next_node(nodes.paragraph)
67-
68-
if para_node:
6963
introduction = para_node.astext().strip().replace("\n", " ")
64+
return introduction
7065

71-
return introduction
66+
return ""
7267

7368

7469
def _generate_items(doctree_dir: Path):

0 commit comments

Comments
 (0)