diff --git a/material/plugins/search/plugin.py b/material/plugins/search/plugin.py index cc88986b1..5c254e3f7 100644 --- a/material/plugins/search/plugin.py +++ b/material/plugins/search/plugin.py @@ -545,6 +545,8 @@ class Parser(HTMLParser): elif data.isspace(): if not self.section.text or not self.section.text[-1].isspace(): self.section.text.append(data) + elif "pre" in self.context: + self.section.text.append(data) # Handle everything else else: diff --git a/src/plugins/search/plugin.py b/src/plugins/search/plugin.py index cc88986b1..5c254e3f7 100644 --- a/src/plugins/search/plugin.py +++ b/src/plugins/search/plugin.py @@ -545,6 +545,8 @@ class Parser(HTMLParser): elif data.isspace(): if not self.section.text or not self.section.text[-1].isspace(): self.section.text.append(data) + elif "pre" in self.context: + self.section.text.append(data) # Handle everything else else: