epub converter: update

This commit is contained in:
shirshasa
2021-04-23 15:21:24 +03:00
parent d5dc3529b7
commit 6cd4f9401d
4 changed files with 16 additions and 5 deletions

View File

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

View File

@@ -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 = {