Fixed search plugin removing indentation for some code blocks

This commit is contained in:
squidfunk 2023-10-02 10:54:59 +02:00
parent 9ac03cf806
commit 8299f1d3a0
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
2 changed files with 4 additions and 0 deletions

View File

@ -545,6 +545,8 @@ class Parser(HTMLParser):
elif data.isspace(): elif data.isspace():
if not self.section.text or not self.section.text[-1].isspace(): if not self.section.text or not self.section.text[-1].isspace():
self.section.text.append(data) self.section.text.append(data)
elif "pre" in self.context:
self.section.text.append(data)
# Handle everything else # Handle everything else
else: else:

View File

@ -545,6 +545,8 @@ class Parser(HTMLParser):
elif data.isspace(): elif data.isspace():
if not self.section.text or not self.section.text[-1].isspace(): if not self.section.text or not self.section.text[-1].isspace():
self.section.text.append(data) self.section.text.append(data)
elif "pre" in self.context:
self.section.text.append(data)
# Handle everything else # Handle everything else
else: else: