diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-31 09:51:21 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-31 09:51:21 -0400 |
commit | e76e977befcee041f203c539e0021e822c28a32e (patch) | |
tree | 9ed5073e9955dc0dca387ccd276d75ef643ec763 /bs4/builder | |
parent | 40d0fcd877e58f2862025f5a39a8ab0861e12b8b (diff) |
The html.parser treebuilder can now handle numeric attributes in
text when the hexidecimal name of the attribute starts with a
capital X.
Diffstat (limited to 'bs4/builder')
-rw-r--r-- | bs4/builder/_htmlparser.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bs4/builder/_htmlparser.py b/bs4/builder/_htmlparser.py index e34c9fa..65ee618 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) |