summaryrefslogtreecommitdiff
path: root/bs4/builder/_html5lib.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2018-12-30 21:13:03 -0500
committerLeonard Richardson <leonardr@segfault.org>2018-12-30 21:13:03 -0500
commitd420395d8c70794d64efe07448283946ee5b074e (patch)
treeccc341799927593743bc7503ec3f1e5ca3dd378f /bs4/builder/_html5lib.py
parentcc6de8c2b4bf4d41b7ab2a7f609e7493c9e0a859 (diff)
downloadbeautifulsoup4-d420395d8c70794d64efe07448283946ee5b074e.tar.gz
Fixed a problem with multi-valued attributes where the value
contained whitespace. Thanks to Jens Svalgaard for the fix. [bug=1787453]
Diffstat (limited to 'bs4/builder/_html5lib.py')
-rw-r--r--bs4/builder/_html5lib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bs4/builder/_html5lib.py b/bs4/builder/_html5lib.py
index 2c929b9..6fa8593 100644
--- a/bs4/builder/_html5lib.py
+++ b/bs4/builder/_html5lib.py
@@ -15,7 +15,7 @@ from bs4.builder import (
)
from bs4.element import (
NamespacedAttribute,
- whitespace_re,
+ nonwhitespace_re,
)
import html5lib
from html5lib.constants import (
@@ -206,7 +206,7 @@ class AttrList(object):
# A node that is being cloned may have already undergone
# this procedure.
if not isinstance(value, list):
- value = whitespace_re.split(value)
+ value = nonwhitespace_re.findall(value)
self.element[name] = value
def items(self):
return list(self.attrs.items())