summaryrefslogtreecommitdiff
path: root/bs4/builder
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2015-09-28 19:53:43 -0400
committerLeonard Richardson <leonardr@segfault.org>2015-09-28 19:53:43 -0400
commitda5887541b28b1551780d2b8574283d66a59ca46 (patch)
tree56cdfadc051a97619e57a535f066bd9549d93f94 /bs4/builder
parentc9520a7c1c5bb789e1a42a0bb5f0fe0a208070ca (diff)
downloadbeautifulsoup4-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.py5
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())