mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 01:03:26 +02:00
DRYer
This commit is contained in:
parent
195ff72d44
commit
869d429cb3
1 changed files with 3 additions and 2 deletions
|
|
@ -576,11 +576,12 @@ def add_block_tag(self, tagname, html_tag, tag_style, stylizer, is_table_cell=Fa
|
|||
else:
|
||||
text = html_tag.text
|
||||
is_list_item = tagname == 'li'
|
||||
if text and is_list_item and not text.strip():
|
||||
has_sublist = is_list_item and len(html_tag) and barename(html_tag[0].tag) in ('ul', 'ol') and len(html_tag[0])
|
||||
if text and has_sublist and not text.strip():
|
||||
text = '' # whitespace only, ignore
|
||||
if text:
|
||||
block.add_text(text, tag_style, ignore_leading_whitespace=True, is_parent_style=True, link=self.current_link, lang=self.current_lang)
|
||||
elif is_list_item and len(html_tag) and barename(html_tag[0].tag) in ('ul', 'ol') and len(html_tag[0]):
|
||||
elif has_sublist:
|
||||
block.force_not_empty = True
|
||||
|
||||
def add_inline_tag(self, tagname, html_tag, tag_style, stylizer):
|
||||
|
|
|
|||
Loading…
Reference in a new issue