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 /beautifulsoup/element.py | |
parent | 2afd7cb857a01f5b59b806f68b06889764c1d754 (diff) |
Convert all entities to Unicode, don't make it configurable.
Diffstat (limited to 'beautifulsoup/element.py')
-rw-r--r-- | beautifulsoup/element.py | 7 |
1 files changed, 2 insertions, 5 deletions
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': |