' -> " in import css file

This commit is contained in:
Kiryl
2022-07-14 19:10:23 +03:00
parent 55372561cd
commit 8624a0a776

View File

@@ -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: