forked from LiveCarta/BookConverter
epub converter: tmp color fix
This commit is contained in:
@@ -76,6 +76,7 @@ LIVECARTA_STYLE_ATTRS = {
|
||||
'vertical-align': ['super'], # <sup>
|
||||
'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 = []
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class LawCartaConfig:
|
||||
'purple': 'darkMagenta',
|
||||
'olive': 'darkGreen',
|
||||
'silver': 'lightGray',
|
||||
'white': 'white',
|
||||
'white': 'black',
|
||||
'maroon': '#800000',
|
||||
'gray': '#808080'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user