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, 5 insertions, 0 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 33cbc19..0aefe73 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -1845,6 +1845,11 @@ class Tag(PageElement):
return space_before + s + space_after
def _format_tag(self, eventual_encoding, formatter, opening):
+ if self.hidden:
+ # A hidden tag is invisible, although its contents
+ # are visible.
+ return ''
+
# A tag starts with the < character (see below).
# Then the / character, if this is a closing tag.