diff --git a/src/css_reader.py b/src/css_reader.py index 433e841..e19935a 100644 --- a/src/css_reader.py +++ b/src/css_reader.py @@ -255,11 +255,12 @@ class TagStyleConverter: if new_tags: tmp_attrs = top_tag.attrs.copy() - top_tag = BeautifulSoup(features='lxml').new_tag(self.tag_initial_name) - top_tag.attrs = tmp_attrs + top_tag.attrs = {} + top_tag2 = BeautifulSoup(features='lxml').new_tag(self.tag_initial_name) + top_tag2.attrs = tmp_attrs if self.style: - top_tag.attrs['style'] = self.style - new_tags[-1].wrap(top_tag) + top_tag2.attrs['style'] = self.style + new_tags[-1].wrap(top_tag2) else: top_tag.attrs['style'] = self.style