From 8624a0a77684958474775df1e60cf07eec57c37b Mon Sep 17 00:00:00 2001 From: Kiryl Date: Thu, 14 Jul 2022 19:10:23 +0300 Subject: [PATCH] ' -> " in import css file --- src/epub_converter/css_processor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/epub_converter/css_processor.py b/src/epub_converter/css_processor.py index 0caad25..fbb2f99 100644 --- a/src/epub_converter/css_processor.py +++ b/src/epub_converter/css_processor.py @@ -106,6 +106,7 @@ class CSSPreprocessor: @staticmethod def style_conditions(style_value, style_name): cleaned_value = style_value.replace("\"", "") + # cleaned_value = style_value.replace("+", "%2B") constraints_on_value = LiveCartaConfig.LIVECARTA_STYLE_ATTRS.get( style_name) value_not_in_possible_values_list = cleaned_value not in LiveCartaConfig.LIVECARTA_STYLE_ATTRS[ @@ -170,7 +171,7 @@ class CSSPreprocessor: # if in css file we import another css if "@import" in str(css_obj.content): path_to_css_from_root = "css/" + \ - re.search("'(.*)'", str(css_obj.content)).group(1) + re.search('"(.*)"', str(css_obj.content)).group(1) css_obj = ebooklib_book.get_item_with_href( path_to_css_from_root) assert css_obj, f"Css style {css_href} was not in manifest." @@ -193,6 +194,7 @@ class CSSPreprocessor: if style_type.name in self.LIVECARTA_STYLE_ATTRS_MAPPING: # function that converts our data func = self.LIVECARTA_STYLE_ATTRS_MAPPING[style_type.name] + print(cleaned_value) css_rule.style[style_type.name] = func(cleaned_value) def build_css_file_content(self, css_content: str) -> str: