Add parameters to html&css merge

This commit is contained in:
Kibzik
2023-02-28 14:09:38 +03:00
parent cb9d312d25
commit 91b8a25e5a
2 changed files with 7 additions and 4 deletions

View File

@@ -258,12 +258,15 @@ def modify_html_soup_with_css_styles(html_soup: BeautifulSoup, css_text: str = "
css_text = css_text.replace(
'@namespace epub "http://www.idpf.org/2007/ops";', '')
# here we add css styles to inline style
html_with_css_styles: str = transform(str(html_soup), css_text=css_text,
html_with_css_styles: str = transform(str(html_soup),
exclude_pseudoclasses=False,
include_star_selectors=True,
remove_classes=False,
external_styles=False,
allow_network=False,
css_text=css_text,
disable_validation=True,
)
allow_network=False)
# soup with converted styles from css
inline_soup = BeautifulSoup(html_with_css_styles, features="lxml")

View File

@@ -58,7 +58,7 @@ class LiveCartaConfig:
"text-decoration": ["underline", "line-through"], # <u> , <s>
"text-decoration-line": ["underline", "line-through"], # <u> , <s>
"text-transform": [],
"text-align": [x for x in ["justify", "right", "center", "left"] if x != "left"],
"text-align": ["justify", "right", "center"],
"text-indent": [],
"margin": [],
"margin-top": [],