summaryrefslogtreecommitdiff
path: root/bs4
diff options
context:
space:
mode:
Diffstat (limited to 'bs4')
-rw-r--r--bs4/__init__.py2
-rw-r--r--bs4/builder/_htmlparser.py2
-rw-r--r--bs4/element.py7
-rw-r--r--bs4/testing.py2
-rw-r--r--bs4/tests/test_tree.py7
5 files changed, 5 insertions, 15 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 956f26e..7b5964a 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -17,7 +17,7 @@ http://www.crummy.com/software/BeautifulSoup/bs4/doc/
"""
__author__ = "Leonard Richardson (leonardr@segfault.org)"
-__version__ = "4.3.0"
+__version__ = "4.2.1"
__copyright__ = "Copyright (c) 2004-2013 Leonard Richardson"
__license__ = "MIT"
diff --git a/bs4/builder/_htmlparser.py b/bs4/builder/_htmlparser.py
index 2b98969..4b80f79 100644
--- a/bs4/builder/_htmlparser.py
+++ b/bs4/builder/_htmlparser.py
@@ -58,6 +58,8 @@ class BeautifulSoupHTMLParser(HTMLParser):
# it's fixed.
if name.startswith('x'):
real_name = int(name.lstrip('x'), 16)
+ elif name.startswith('X'):
+ real_name = int(name.lstrip('X'), 16)
else:
real_name = int(name)
diff --git a/bs4/element.py b/bs4/element.py
index 538f6b6..f6864f2 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -672,13 +672,6 @@ class NavigableString(unicode, PageElement):
output = self.format_string(self, formatter)
return self.PREFIX + output + self.SUFFIX
- @property
- def name(self):
- return None
-
- @name.setter
- def name(self, name):
- raise AttributeError("A NavigableString cannot be given a name.")
class PreformattedString(NavigableString):
"""A NavigableString not subject to the normal formatting rules.
diff --git a/bs4/testing.py b/bs4/testing.py
index c363a89..fd4495a 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -228,12 +228,14 @@ class HTMLTreeBuilderSmokeTest(object):
expect = u'<p id="pi\N{LATIN SMALL LETTER N WITH TILDE}ata"></p>'
self.assertSoupEquals('<p id="pi&#241;ata"></p>', expect)
self.assertSoupEquals('<p id="pi&#xf1;ata"></p>', expect)
+ self.assertSoupEquals('<p id="pi&#Xf1;ata"></p>', expect)
self.assertSoupEquals('<p id="pi&ntilde;ata"></p>', expect)
def test_entities_in_text_converted_to_unicode(self):
expect = u'<p>pi\N{LATIN SMALL LETTER N WITH TILDE}ata</p>'
self.assertSoupEquals("<p>pi&#241;ata</p>", expect)
self.assertSoupEquals("<p>pi&#xf1;ata</p>", expect)
+ self.assertSoupEquals("<p>pi&#Xf1;ata</p>", expect)
self.assertSoupEquals("<p>pi&ntilde;ata</p>", expect)
def test_quot_entity_converted_to_quotation_mark(self):
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index fc0e2c6..2d09f96 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -1187,13 +1187,6 @@ class TestElementObjects(SoupTest):
soup = self.soup("foo<!--IGNORE-->bar")
self.assertEqual(['foo', 'bar'], list(soup.strings))
- def test_string_has_immutable_name_property(self):
- string = self.soup("s").string
- self.assertEqual(None, string.name)
- def t():
- string.name = 'foo'
- self.assertRaises(AttributeError, t)
-
class TestCDAtaListAttributes(SoupTest):
"""Testing cdata-list attributes like 'class'.