'Replaces class="foo bar" with class=["foo", "bar"]
Modifies its input in place.'

def _replace_cdata_list_attribute_values(self, tag_name, attrs):

    if self.cdata_list_attributes:
        universal = self.cdata_list_attributes.get('*', [])
        tag_specific = self.cdata_list_attributes.get(tag_name.lower(), [])
        for cdata_list_attr in itertools.chain(universal, tag_specific):
            if (cdata_list_attr in dict(attrs)):
                value = attrs[cdata_list_attr]
                if isinstance(value, basestring):
                    values = whitespace_re.split(value)
                else:
                    values = value
                attrs[cdata_list_attr] = values
    return attrs
