summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bs4/builder/_html5lib.py4
-rw-r--r--bs4/element.py9
2 files changed, 2 insertions, 11 deletions
diff --git a/bs4/builder/_html5lib.py b/bs4/builder/_html5lib.py
index b8c2bb6..2d6fe31 100644
--- a/bs4/builder/_html5lib.py
+++ b/bs4/builder/_html5lib.py
@@ -149,9 +149,7 @@ class Element(html5lib.treebuilders._base.Node):
#
# The Tag constructor called this method when the Tag was created,
# but we just set/changed the attributes, so call it again.
- self.element.contains_substitutions = (
- self.soup.builder.set_up_substitutions(
- self.element))
+ self.soup.builder.set_up_substitutions(self.element)
attributes = property(getAttributes, setAttributes)
def insertText(self, data, insertBefore=None):
diff --git a/bs4/element.py b/bs4/element.py
index 3729789..aa9a3e9 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -636,11 +636,6 @@ class PageElement(object):
def parentGenerator(self):
return self.parents
- # Utility methods
- def substitute_encoding(self, str, encoding=None):
- encoding = encoding or "utf-8"
- return str.replace("%SOUP-ENCODING%", encoding)
-
class NavigableString(unicode, PageElement):
@@ -761,11 +756,9 @@ class Tag(PageElement):
# Set up any substitutions, such as the charset in a META tag.
if builder is not None:
- self.contains_substitutions = builder.set_up_substitutions(self)
-
+ builder.set_up_substitutions(self)
self.can_be_empty_element = builder.can_be_empty_element(name)
else:
- self.contains_substitutions = False
self.can_be_empty_element = False
parserClass = _alias("parser_class") # BS3