mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed search crashing for some nested heading combinations (9.0.3 regression)
This commit is contained in:
parent
c31ef005b4
commit
e7013e66a9
@ -421,11 +421,11 @@ class Parser(HTMLParser):
|
||||
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
||||
if self.section.depth > len(self.context):
|
||||
for section in reversed(self.data):
|
||||
if section.depth and section.depth <= len(self.context):
|
||||
if section.depth <= len(self.context):
|
||||
|
||||
# Set depth to 0 in order to denote that the current section
|
||||
# is exited and must not be considered again.
|
||||
self.section.depth = 0
|
||||
# Set depth to infinity in order to denote that the current
|
||||
# section is exited and must never be considered again.
|
||||
self.section.depth = float("inf")
|
||||
self.section = section
|
||||
break
|
||||
|
||||
|
@ -421,11 +421,11 @@ class Parser(HTMLParser):
|
||||
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
||||
if self.section.depth > len(self.context):
|
||||
for section in reversed(self.data):
|
||||
if section.depth and section.depth <= len(self.context):
|
||||
if section.depth <= len(self.context):
|
||||
|
||||
# Set depth to 0 in order to denote that the current section
|
||||
# is exited and must not be considered again.
|
||||
self.section.depth = 0
|
||||
# Set depth to infinity in order to denote that the current
|
||||
# section is exited and must never be considered again.
|
||||
self.section.depth = float("inf")
|
||||
self.section = section
|
||||
break
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user