forked from LiveCarta/BookConverter
epub converter: fix
This commit is contained in:
@@ -346,7 +346,10 @@ def get_tags_between_chapter_marks(first_id, href, html_soup):
|
|||||||
next_tag = marked_tags.next_sibling
|
next_tag = marked_tags.next_sibling
|
||||||
tags = []
|
tags = []
|
||||||
while next_tag:
|
while next_tag:
|
||||||
if next_tag.attrs.get('class') == 'converter-chapter-mark':
|
# TODO: why we hve there NavString
|
||||||
|
|
||||||
|
if not isinstance(next_tag, NavigableString) and\
|
||||||
|
(next_tag.attrs.get('class') == 'converter-chapter-mark'):
|
||||||
break
|
break
|
||||||
tags.append(next_tag)
|
tags.append(next_tag)
|
||||||
next_tag = next_tag.next_sibling
|
next_tag = next_tag.next_sibling
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ class LawCartaConfig:
|
|||||||
'olive': 'darkGreen',
|
'olive': 'darkGreen',
|
||||||
'silver': 'lightGray',
|
'silver': 'lightGray',
|
||||||
'white': 'white',
|
'white': 'white',
|
||||||
'maroon': '#800000',
|
'maroon': 'darkRed', # '#800000',
|
||||||
'gray': '#808080',
|
'gray': 'darkGray',
|
||||||
'grey': '#808080'
|
'grey': 'darkGray',
|
||||||
}
|
}
|
||||||
INDENT = '30px'
|
INDENT = '30px'
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ def str2color_name(s: str):
|
|||||||
if s in ['#FFD472', '#F47B4D', '#FFFBEF', '#F47B4D']:
|
if s in ['#FFD472', '#F47B4D', '#FFFBEF', '#F47B4D']:
|
||||||
return 'olive'
|
return 'olive'
|
||||||
if s in ['#B0DFD7', '#EFF8F6', '#5CC4B7']:
|
if s in ['#B0DFD7', '#EFF8F6', '#5CC4B7']:
|
||||||
return 'teal2'
|
return 'teal'
|
||||||
name = get_hex_color_name(s)
|
name = get_hex_color_name(s)
|
||||||
if (name == 'white') and (s.lower() not in ['#ffffff', '#fff']):
|
if (name == 'white') and (s.lower() not in ['#ffffff', '#fff']):
|
||||||
name = 'gray'
|
name = 'gray'
|
||||||
|
|||||||
Reference in New Issue
Block a user