From 526a381d2ef3257a87348756f955d8148ab0e000 Mon Sep 17 00:00:00 2001 From: Kiryl Date: Tue, 6 Sep 2022 13:17:20 +0300 Subject: [PATCH] Move align to style attr. --- src/style_preprocessor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/style_preprocessor.py b/src/style_preprocessor.py index e0e332c..da05488 100644 --- a/src/style_preprocessor.py +++ b/src/style_preprocessor.py @@ -1,7 +1,6 @@ import re import cssutils -from bs4 import BeautifulSoup -from typing import Tuple, Dict +from typing import Tuple from os.path import dirname, normpath, join from src.util.color_reader import str2hex @@ -167,6 +166,8 @@ class StylePreprocessor: for tag_initial_inline_style in tags_with_inline_style: inline_style = tag_initial_inline_style.attrs["style"] + if tag_initial_inline_style.attrs.get("align"): + inline_style += f";text-align: {tag_initial_inline_style.attrs['align']};" tag_initial_inline_style.attrs["style"] = \ self.build_inline_style_content(inline_style)