summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index ace72f1..75c1aaa 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -279,6 +279,7 @@ class BeautifulSoup(Tag):
parent = parent or self.currentTag
most_recent_element = most_recent_element or self._most_recent_element
o.setup(parent, most_recent_element)
+
if most_recent_element is not None:
most_recent_element.next_element = o
self._most_recent_element = o