diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-09-28 19:53:43 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-09-28 19:53:43 -0400 |
commit | da5887541b28b1551780d2b8574283d66a59ca46 (patch) | |
tree | 56cdfadc051a97619e57a535f066bd9549d93f94 /bs4/builder | |
parent | c9520a7c1c5bb789e1a42a0bb5f0fe0a208070ca (diff) | |
download | beautifulsoup4-da5887541b28b1551780d2b8574283d66a59ca46.tar.gz |
Fixed a parse bug with the html5lib tree-builder. Thanks to Roel
Kramer for the patch. [bug=1483781]
Diffstat (limited to 'bs4/builder')
-rw-r--r-- | bs4/builder/_html5lib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bs4/builder/_html5lib.py b/bs4/builder/_html5lib.py index ab5793c..8725a65 100644 --- a/bs4/builder/_html5lib.py +++ b/bs4/builder/_html5lib.py @@ -120,7 +120,10 @@ class AttrList(object): if (name in list_attr['*'] or (self.element.name in list_attr and name in list_attr[self.element.name])): - value = whitespace_re.split(value) + # A node that is being cloned may have already undergone + # this procedure. + if not isinstance(value, list): + value = whitespace_re.split(value) self.element[name] = value def items(self): return list(self.attrs.items()) |