From 7484b19e9aa5712b8e22ae03786cba68fbde65cc Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 8 Jan 2023 09:40:01 +0100 Subject: [PATCH] Removed unnecessary code from search plugin --- material/plugins/search/plugin.py | 4 +++- src/plugins/search/plugin.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/material/plugins/search/plugin.py b/material/plugins/search/plugin.py index 710746bec..89f72b4ba 100644 --- a/material/plugins/search/plugin.py +++ b/material/plugins/search/plugin.py @@ -401,8 +401,10 @@ class Parser(HTMLParser): # Render opening tag if kept if not self.skip.intersection(self.context): if tag in self.keep: + + # Check whether we're inside the section title data = self.section.text - if self.section.el in reversed(self.context): + if self.section.el in self.context: data = self.section.title # Append to section title or text diff --git a/src/plugins/search/plugin.py b/src/plugins/search/plugin.py index 710746bec..89f72b4ba 100644 --- a/src/plugins/search/plugin.py +++ b/src/plugins/search/plugin.py @@ -401,8 +401,10 @@ class Parser(HTMLParser): # Render opening tag if kept if not self.skip.intersection(self.context): if tag in self.keep: + + # Check whether we're inside the section title data = self.section.text - if self.section.el in reversed(self.context): + if self.section.el in self.context: data = self.section.title # Append to section title or text