diff options
author | Leonard Richardson <leonardr@segfault.org> | 2022-04-10 13:42:02 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2022-04-10 13:42:02 -0400 |
commit | 92b50fc6ae57038a09e9cace20604613b1b345e8 (patch) | |
tree | e695bca9b85d605272dee2128ffd4fe69af4b0d5 /bs4/builder/_html5lib.py | |
parent | bae2e2ca3565a75fcff1d2bc911f0a2e022761b4 (diff) |
Fixed another crash when overriding multi_valued_attributes and using the
html5lib parser. [bug=1948488]
Diffstat (limited to 'bs4/builder/_html5lib.py')
-rw-r--r-- | bs4/builder/_html5lib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bs4/builder/_html5lib.py b/bs4/builder/_html5lib.py index 58bc176..12dee07 100644 --- a/bs4/builder/_html5lib.py +++ b/bs4/builder/_html5lib.py @@ -249,9 +249,9 @@ class AttrList(object): # If this attribute is a multi-valued attribute for this element, # turn its value into a list. list_attr = self.element.cdata_list_attributes or {} - if (name in list_attr.get('*') + if (name in list_attr.get('*', []) or (self.element.name in list_attr - and name in list_attr[self.element.name])): + and name in list_attr.get(self.element.name, []))): # A node that is being cloned may have already undergone # this procedure. if not isinstance(value, list): |