diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 06:50:34 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 06:50:34 -0500 |
commit | f141f1c2c0c159057c03cd44b3c6b9e26731ac03 (patch) | |
tree | 2a46ad99d5a4d9aa00d39aa82020a9abc7f0df16 | |
parent | 2afd7cb857a01f5b59b806f68b06889764c1d754 (diff) |
Convert all entities to Unicode, don't make it configurable.
-rw-r--r-- | beautifulsoup/__init__.py | 2 | ||||
-rw-r--r-- | beautifulsoup/element.py | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/beautifulsoup/__init__.py b/beautifulsoup/__init__.py index ddf51f9..e23c9d9 100644 --- a/beautifulsoup/__init__.py +++ b/beautifulsoup/__init__.py @@ -171,7 +171,7 @@ class BeautifulStoneSoup(Tag): else: dammit = UnicodeDammit\ (markup, [self.fromEncoding, inDocumentEncoding], - smartQuotesTo=self.builder.smart_quotes_to, isHTML=isHTML) + isHTML=isHTML) markup = dammit.unicode self.originalEncoding = dammit.originalEncoding self.declaredHTMLEncoding = dammit.declaredHTMLEncoding diff --git a/beautifulsoup/element.py b/beautifulsoup/element.py index 8749114..0216255 100644 --- a/beautifulsoup/element.py +++ b/beautifulsoup/element.py @@ -395,13 +395,10 @@ class Tag(PageElement, Entities): entities are being converted, any unrecognized entities are escaped.""" x = match.group(1) - if builder.convert_html_entities and x in name2codepoint: + if x in name2codepoint: return unichr(name2codepoint[x]) elif x in self.XML_ENTITIES_TO_SPECIAL_CHARS: - if builder.convert_xml_entities: - return self.XML_ENTITIES_TO_SPECIAL_CHARS[x] - else: - return u'&%s;' % x + return self.XML_ENTITIES_TO_SPECIAL_CHARS[x] elif len(x) > 0 and x[0] == '#': # Handle numeric entities if len(x) > 1 and x[1] == 'x': |