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:
@@ -421,11 +421,11 @@ class Parser(HTMLParser):
|
|||||||
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
||||||
if self.section.depth > len(self.context):
|
if self.section.depth > len(self.context):
|
||||||
for section in reversed(self.data):
|
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
|
# Set depth to infinity in order to denote that the current
|
||||||
# is exited and must not be considered again.
|
# section is exited and must never be considered again.
|
||||||
self.section.depth = 0
|
self.section.depth = float("inf")
|
||||||
self.section = section
|
self.section = section
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -421,11 +421,11 @@ class Parser(HTMLParser):
|
|||||||
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
# which could also be a nested section – see https://bit.ly/3IxxIJZ
|
||||||
if self.section.depth > len(self.context):
|
if self.section.depth > len(self.context):
|
||||||
for section in reversed(self.data):
|
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
|
# Set depth to infinity in order to denote that the current
|
||||||
# is exited and must not be considered again.
|
# section is exited and must never be considered again.
|
||||||
self.section.depth = 0
|
self.section.depth = float("inf")
|
||||||
self.section = section
|
self.section = section
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user