forked from LiveCarta/BookConverter
epub converter: update
This commit is contained in:
@@ -59,6 +59,8 @@ def str2color_name(s: str):
|
||||
name = get_hex_colour_name(s)
|
||||
return name
|
||||
|
||||
elif s in html4_hex_to_names.items():
|
||||
return s
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ LIVECARTA_STYLE_ATTRS_MAPPING = {
|
||||
'font': lambda x: '',
|
||||
'font-family': lambda x: LawCartaConfig.font_correspondence_table.get(x.capitalize()),
|
||||
'font-size': convert_font_size,
|
||||
'color': str2color_name,
|
||||
'background-color': str2color_name,
|
||||
'color': lambda x: LawCartaConfig.HTML42LIVECARTA_COLORS.get(str2color_name(x), ''),
|
||||
'background-color': lambda x: LawCartaConfig.HTML42LIVECARTA_COLORS.get(str2color_name(x), ''),
|
||||
}
|
||||
|
||||
LIVECARTA_STYLE_ATTRS_SHOULD_BE_TAG = {
|
||||
|
||||
Reference in New Issue
Block a user