Skip to content

Commit 8299f1d

Browse files
committed
Fixed search plugin removing indentation for some code blocks
1 parent 9ac03cf commit 8299f1d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

material/plugins/search/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ def handle_data(self, data):
545545
elif data.isspace():
546546
if not self.section.text or not self.section.text[-1].isspace():
547547
self.section.text.append(data)
548+
elif "pre" in self.context:
549+
self.section.text.append(data)
548550

549551
# Handle everything else
550552
else:

src/plugins/search/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ def handle_data(self, data):
545545
elif data.isspace():
546546
if not self.section.text or not self.section.text[-1].isspace():
547547
self.section.text.append(data)
548+
elif "pre" in self.context:
549+
self.section.text.append(data)
548550

549551
# Handle everything else
550552
else:

0 commit comments

Comments
 (0)