forked from LiveCarta/BookConverter
Add parameters to html&css merge
This commit is contained in:
@@ -258,12 +258,15 @@ def modify_html_soup_with_css_styles(html_soup: BeautifulSoup, css_text: str = "
|
|||||||
css_text = css_text.replace(
|
css_text = css_text.replace(
|
||||||
'@namespace epub "http://www.idpf.org/2007/ops";', '')
|
'@namespace epub "http://www.idpf.org/2007/ops";', '')
|
||||||
# here we add css styles to inline style
|
# 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,
|
remove_classes=False,
|
||||||
external_styles=False,
|
external_styles=False,
|
||||||
allow_network=False,
|
css_text=css_text,
|
||||||
disable_validation=True,
|
disable_validation=True,
|
||||||
)
|
allow_network=False)
|
||||||
|
|
||||||
# soup with converted styles from css
|
# soup with converted styles from css
|
||||||
inline_soup = BeautifulSoup(html_with_css_styles, features="lxml")
|
inline_soup = BeautifulSoup(html_with_css_styles, features="lxml")
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class LiveCartaConfig:
|
|||||||
"text-decoration": ["underline", "line-through"], # <u> , <s>
|
"text-decoration": ["underline", "line-through"], # <u> , <s>
|
||||||
"text-decoration-line": ["underline", "line-through"], # <u> , <s>
|
"text-decoration-line": ["underline", "line-through"], # <u> , <s>
|
||||||
"text-transform": [],
|
"text-transform": [],
|
||||||
"text-align": [x for x in ["justify", "right", "center", "left"] if x != "left"],
|
"text-align": ["justify", "right", "center"],
|
||||||
"text-indent": [],
|
"text-indent": [],
|
||||||
"margin": [],
|
"margin": [],
|
||||||
"margin-top": [],
|
"margin-top": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user