diff options
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bs4/element.py b/bs4/element.py index 91a4007..744a4e0 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -1000,15 +1000,16 @@ class Tag(PageElement): attrs.append(decoded) close = '' closeTag = '' - if self.is_empty_element: - close = '/' - else: - closeTag = '</%s>' % self.name prefix = '' if self.prefix: prefix = self.prefix + ":" + if self.is_empty_element: + close = '/' + else: + closeTag = '</%s%s>' % (prefix, self.name) + pretty_print = (indent_level is not None) if pretty_print: space = (' ' * (indent_level - 1)) @@ -1120,6 +1121,7 @@ class Tag(PageElement): callable that takes a string and returns whether or not the string matches for some custom definition of 'matches'. The same is true of the tag name.""" + generator = self.descendants if not recursive: generator = self.children |