summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py
index a57027e..07bd893 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -1173,7 +1173,10 @@ class Tag(PageElement):
"""Should this tag be pretty-printed?"""
return (
indent_level is not None
- and self.name not in self.preserve_whitespace_tags
+ and (
+ not self.preserve_whitespace_tags
+ or self.name not in self.preserve_whitespace_tags
+ )
)
def prettify(self, encoding=None, formatter="minimal"):