diff --git a/material/plugins/search/plugin.py b/material/plugins/search/plugin.py index d059043a0..77ec503ff 100644 --- a/material/plugins/search/plugin.py +++ b/material/plugins/search/plugin.py @@ -432,7 +432,8 @@ class Parser(HTMLParser): # Remove element from skip list el = self.context.pop() if el in self.skip: - self.skip.remove(el) + if el.tag not in ["script", "style", "object"]: + self.skip.remove(el) return # Render closing tag if kept diff --git a/src/plugins/search/plugin.py b/src/plugins/search/plugin.py index d059043a0..77ec503ff 100644 --- a/src/plugins/search/plugin.py +++ b/src/plugins/search/plugin.py @@ -432,7 +432,8 @@ class Parser(HTMLParser): # Remove element from skip list el = self.context.pop() if el in self.skip: - self.skip.remove(el) + if el.tag not in ["script", "style", "object"]: + self.skip.remove(el) return # Render closing tag if kept