forked from LiveCarta/BookConverter
' -> " in import css file
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user