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 | 31cf0828b3b339c6136de1193fb6619d5c9c12ea (patch) | |
tree | b37c80349cd9ea0b6167e568d53a3f7dc89ab8d3 /bs4/builder/_html5lib.py | |
parent | 85049f49a4571c4419440e72e8faed062516858d (diff) |
Fixed a parse bug with the html5lib tree-builder. Thanks to Roel
Kramer for the patch. [bug=1483781]
Diffstat (limited to 'bs4/builder/_html5lib.py')
-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()) |