Skip to content

Commit 387804d

Browse files
Fix help.py title parsing
1 parent 3780e9d commit 387804d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/idlelib/help.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ def handle_data(self, data):
155155
d = data if self.pre else data.replace('\n', ' ')
156156
if self.tags == 'h1':
157157
try:
158-
self.hprefix = d[0:d.index(' ')]
158+
self.hprefix = d[:d.index(' ')]
159+
if not self.hprefix.isdigit():
160+
self.hprefix = ''
159161
except ValueError:
160162
self.hprefix = ''
161163
if self.tags in ['h1', 'h2', 'h3']:

0 commit comments

Comments
 (0)