diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | bs4/__init__.py | 5 |
2 files changed, 5 insertions, 3 deletions
@@ -4,6 +4,9 @@ namespaced attribute is the empty string, as opposed to None. [bug=1915583] +* Performance improvement when processing tags that speeds up overall + tree construction by 2%. Patch by Morotti. [bug=1899358] + * Improve the warning issued when a directory name (as opposed to the name of a regular file) is passed as markup into the BeautifulSoup constructor. [bug=1913628] diff --git a/bs4/__init__.py b/bs4/__init__.py index e33f62a..3714d67 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -553,9 +553,7 @@ class BeautifulSoup(Tag): def endData(self, containerClass=None): """Method called by the TreeBuilder when the end of a data segment occurs. - """ - containerClass = self.string_container(containerClass) - + """ if self.current_data: current_data = u''.join(self.current_data) # If whitespace is not preserved, and this string contains @@ -582,6 +580,7 @@ class BeautifulSoup(Tag): not self.parse_only.search(current_data)): return + containerClass = self.string_container(containerClass) o = containerClass(current_data) self.object_was_parsed(o) |