epub converter: fix adding nested style tags

This commit is contained in:
shirshasa
2021-09-07 16:13:14 +03:00
parent e6b341bac9
commit 53d43dd061

View File

@@ -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