File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -421,11 +421,11 @@ def handle_endtag(self, tag):
421
421
# which could also be a nested section – see https://bit.ly/3IxxIJZ
422
422
if self .section .depth > len (self .context ):
423
423
for section in reversed (self .data ):
424
- if section .depth and section . depth <= len (self .context ):
424
+ if section .depth <= len (self .context ):
425
425
426
- # Set depth to 0 in order to denote that the current section
427
- # is exited and must not be considered again.
428
- self .section .depth = 0
426
+ # Set depth to infinity in order to denote that the current
427
+ # section is exited and must never be considered again.
428
+ self .section .depth = float ( "inf" )
429
429
self .section = section
430
430
break
431
431
Original file line number Diff line number Diff line change @@ -421,11 +421,11 @@ def handle_endtag(self, tag):
421
421
# which could also be a nested section – see https://bit.ly/3IxxIJZ
422
422
if self .section .depth > len (self .context ):
423
423
for section in reversed (self .data ):
424
- if section .depth and section . depth <= len (self .context ):
424
+ if section .depth <= len (self .context ):
425
425
426
- # Set depth to 0 in order to denote that the current section
427
- # is exited and must not be considered again.
428
- self .section .depth = 0
426
+ # Set depth to infinity in order to denote that the current
427
+ # section is exited and must never be considered again.
428
+ self .section .depth = float ( "inf" )
429
429
self .section = section
430
430
break
431
431
You can’t perform that action at this time.
0 commit comments