diff --git a/src/css_reader.py b/src/css_reader.py index 4e24b53..bd2dc17 100644 --- a/src/css_reader.py +++ b/src/css_reader.py @@ -383,10 +383,11 @@ def add_inline_style_to_html_soup(soup1: BeautifulSoup, css_text: str): for i in livecarta_tmp_ids: tag = soup1.find(attrs={'livecarta_id': i}) tag_with_style = soup2.find(attrs={'livecarta_id': i}) + del tag.attrs['livecarta_id'] if tag_with_style.attrs.get('style'): style_converter = TagStyleConverter(tag, tag_with_style) style_converter.convert_initial_tag() - del tag.attrs['livecarta_id'] + return soup1