From 8299f1d3a0443ace1848463737c7d5c07a282b83 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 2 Oct 2023 10:54:59 +0200 Subject: [PATCH] Fixed search plugin removing indentation for some code blocks --- material/plugins/search/plugin.py | 2 ++ src/plugins/search/plugin.py | 2 ++ 2 files changed, 4 insertions(+) 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: