File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff 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
7469def _generate_items (doctree_dir : Path ):
You can’t perform that action at this time.
0 commit comments