diff options
-rw-r--r-- | NEWS.txt | 4 | ||||
-rw-r--r-- | bs4/element.py | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,7 @@ += 4.0.4 () = + +* Fixed a bug that sometimes created disconnected trees. + = 4.0.3 (20120403) = * Fixed a typo that caused some versions of Python 3 to convert the diff --git a/bs4/element.py b/bs4/element.py index 4ff9cd4..bd4c3aa 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -62,6 +62,8 @@ class PageElement(object): other elements.""" self.parent = parent self.previous_element = previous_element + if previous_element is not None: + self.previous_element.next_element = self self.next_element = None self.previous_sibling = None self.next_sibling = None |