File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -421,11 +421,11 @@ def handle_endtag(self, tag):
421421 # which could also be a nested section – see https://bit.ly/3IxxIJZ
422422 if self .section .depth > len (self .context ):
423423 for section in reversed (self .data ):
424- if section .depth and section . depth <= len (self .context ):
424+ if section .depth <= len (self .context ):
425425
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" )
429429 self .section = section
430430 break
431431
Original file line number Diff line number Diff line change @@ -421,11 +421,11 @@ def handle_endtag(self, tag):
421421 # which could also be a nested section – see https://bit.ly/3IxxIJZ
422422 if self .section .depth > len (self .context ):
423423 for section in reversed (self .data ):
424- if section .depth and section . depth <= len (self .context ):
424+ if section .depth <= len (self .context ):
425425
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" )
429429 self .section = section
430430 break
431431
You can’t perform that action at this time.
0 commit comments