summaryrefslogtreecommitdiff
path: root/beautifulsoup/builder
diff options
context:
space:
mode:
Diffstat (limited to 'beautifulsoup/builder')
-rw-r--r--beautifulsoup/builder/__init__.py10
-rw-r--r--beautifulsoup/builder/html5lib_builder.py4
-rw-r--r--beautifulsoup/builder/lxml_builder.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/beautifulsoup/builder/__init__.py b/beautifulsoup/builder/__init__.py
index 5bf5929..5c275d7 100644
--- a/beautifulsoup/builder/__init__.py
+++ b/beautifulsoup/builder/__init__.py
@@ -120,8 +120,8 @@ class HTMLTreeBuilder(TreeBuilder):
# This is an interesting meta tag.
match = self.CHARSET_RE.search(content)
if match:
- if (self.soup.declaredHTMLEncoding is not None or
- self.soup.originalEncoding == self.soup.fromEncoding):
+ if (self.soup.declared_html_encoding is not None or
+ self.soup.original_encoding == self.soup.fromEncoding):
# An HTML encoding was sniffed while converting
# the document to Unicode, or an HTML encoding was
# sniffed during a previous pass through the
@@ -136,9 +136,9 @@ class HTMLTreeBuilder(TreeBuilder):
# Go through it again with the encoding information.
new_charset = match.group(3)
if (new_charset is not None
- and new_charset != self.soup.originalEncoding):
- self.soup.declaredHTMLEncoding = new_charset
- self.soup._feed(self.soup.declaredHTMLEncoding)
+ and new_charset != self.soup.original_encoding):
+ self.soup.declared_html_encoding = new_charset
+ self.soup._feed(self.soup.declared_html_encoding)
raise StopParsing
pass
return False
diff --git a/beautifulsoup/builder/html5lib_builder.py b/beautifulsoup/builder/html5lib_builder.py
index 95151da..0a24ce1 100644
--- a/beautifulsoup/builder/html5lib_builder.py
+++ b/beautifulsoup/builder/html5lib_builder.py
@@ -27,9 +27,9 @@ class HTML5TreeBuilder(HTMLTreeBuilder):
if isinstance(markup, unicode):
# We need to special-case this because html5lib sets
# charEncoding to UTF-8 if it gets Unicode input.
- doc.originalEncoding = None
+ doc.original_encoding = None
else:
- doc.originalEncoding = parser.tokenizer.stream.charEncoding[0]
+ doc.original_encoding = parser.tokenizer.stream.charEncoding[0]
def create_treebuilder(self, namespaceHTMLElements):
self.underlying_builder = TreeBuilderForHtml5lib(
diff --git a/beautifulsoup/builder/lxml_builder.py b/beautifulsoup/builder/lxml_builder.py
index a1f8c1e..2c264b3 100644
--- a/beautifulsoup/builder/lxml_builder.py
+++ b/beautifulsoup/builder/lxml_builder.py
@@ -23,7 +23,7 @@ class LXMLTreeBuilder(HTMLTreeBuilder):
try_encodings = [user_specified_encoding, document_declared_encoding]
dammit = UnicodeDammit(markup, try_encodings, isHTML=True)
- return dammit.markup, dammit.originalEncoding, dammit.declaredHTMLEncoding
+ return dammit.markup, dammit.original_encoding, dammit.declared_html_encoding
def feed(self, markup):