Font -> span out of presets

This commit is contained in:
Kiryl
2022-09-09 15:13:02 +03:00
parent a571cb7009
commit ca728973f2
3 changed files with 12 additions and 7 deletions

View File

@@ -112,7 +112,7 @@ class Docx2LibreHtml:
"""Method for reading .html file into beautiful soup tag."""
try:
html_text = open(html_path, "r", encoding="utf8").read()
self.logger_object.log("HTML for book has been loaded.")
self.logger_object.log("Html for book has been loaded.")
except FileNotFoundError as exc:
self.logger_object.log("There is no html to process."
"Conversion went wrong or you specified wrong paths.", logging.ERROR)

View File

@@ -283,9 +283,19 @@ class HtmlDocxProcessor:
access=None,
html_path: pathlib.Path = "",
book_id: int = 0) -> Tuple[List[Tag], List[str], List[Dict[str, Union[str, bool]]]]:
"""Process html code to satisfy LiveCarta formatting."""
"""Process html to satisfy LiveCarta formatting."""
self.logger.log("Beginning of processing .html file.")
# Process styles doesn't see <fonts> because they aren't supported by html
self._font_to_span()
self.logger.log("Inline style reading.")
self.style_preprocessor.process_inline_styles_in_html_soup(
self.body_tag)
self.logger.log("Inline style processing.")
modify_html_soup_with_css_styles(self.body_tag)
self.logger.log("Image processing.")
self.images = process_images(access, path_to_html=html_path,
book_id=book_id, body_tag=self.body_tag)