From 268f7a3dc59da9200bd39b80ebe59e08a3248a54 Mon Sep 17 00:00:00 2001 From: shirshasa Date: Fri, 28 May 2021 19:33:24 +0300 Subject: [PATCH] epub converter: tmp color fix --- src/css_reader.py | 3 +++ src/livecarta_config.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/css_reader.py b/src/css_reader.py index 8bdc884..d8aef20 100644 --- a/src/css_reader.py +++ b/src/css_reader.py @@ -76,6 +76,7 @@ LIVECARTA_STYLE_ATTRS = { 'vertical-align': ['super'], # 'color': [], 'background-color': [], + 'background': [], 'width': [], 'border-top-width': [], 'border-right-width': [], @@ -99,6 +100,7 @@ LIVECARTA_STYLE_ATTRS_MAPPING = { 'font-size': convert_font_size, 'color': lambda x: LawCartaConfig.HTML42LIVECARTA_COLORS.get(str2color_name(x), ''), 'background-color': lambda x: LawCartaConfig.HTML42LIVECARTA_COLORS.get(str2color_name(x), ''), + 'background': lambda x: LawCartaConfig.HTML42LIVECARTA_COLORS.get(str2color_name(x), ''), 'border-top-width': lambda x: x if x != '0' else '', 'border-right-width': lambda x: x if x != '0' else '', 'border-left-width': lambda x: x if x != '0' else '', @@ -188,6 +190,7 @@ def add_inline_style_to_html_soup(soup1, css_text): tag_with_style = soup2.find(attrs={'livecarta_id': i}) if tag_with_style.attrs.get('style'): style = tag_with_style.attrs.get('style') + ';' + style = style.replace('background:', 'background-color:') to_remove = check_style_to_be_tag(style) new_tags = [] diff --git a/src/livecarta_config.py b/src/livecarta_config.py index d4f9743..e8264e6 100644 --- a/src/livecarta_config.py +++ b/src/livecarta_config.py @@ -102,7 +102,7 @@ class LawCartaConfig: 'purple': 'darkMagenta', 'olive': 'darkGreen', 'silver': 'lightGray', - 'white': 'white', + 'white': 'black', 'maroon': '#800000', 'gray': '#808080' }