summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 22ecc43..6406bef 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -159,10 +159,10 @@ class BeautifulSoup(Tag):
def object_was_parsed(self, o):
"""Add an object to the parse tree."""
- o.setup(self.currentTag, self.previous)
- if self.previous:
- self.previous.next = o
- self.previous = o
+ o.setup(self.currentTag, self.previous_element)
+ if self.previous_element:
+ self.previous_element.next_element = o
+ self.previous_element = o
self.currentTag.contents.append(o)
@@ -206,12 +206,12 @@ class BeautifulSoup(Tag):
return None
tag = Tag(self, self.builder, name, attrs, self.currentTag,
- self.previous)
+ self.previous_element)
if tag is None:
return tag
- if self.previous:
- self.previous.next = tag
- self.previous = tag
+ if self.previous_element:
+ self.previous_element.next_element = tag
+ self.previous_element = tag
self.pushTag(tag)
return tag