mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
This commit is contained in:
parent
674ff88942
commit
1bff449a4c
@ -539,24 +539,24 @@ class HTMLConverter(object):
|
||||
|
||||
|
||||
def get_text(self, tag, limit=None):
|
||||
css = self.tag_css(tag)[0]
|
||||
if (css.has_key('display') and css['display'].lower() == 'none') or \
|
||||
(css.has_key('visibility') and css['visibility'].lower() == 'hidden'):
|
||||
return ''
|
||||
text = u''
|
||||
for c in tag.contents:
|
||||
if limit != None and len(text) > limit:
|
||||
break
|
||||
if isinstance(c, HTMLConverter.IGNORED_TAGS):
|
||||
return u''
|
||||
if isinstance(c, NavigableString):
|
||||
text += unicode(c)
|
||||
elif isinstance(c, Tag):
|
||||
if c.name.lower() == 'img' and c.has_key('alt'):
|
||||
text += c['alt']
|
||||
return text
|
||||
text += self.get_text(c)
|
||||
return text
|
||||
css = self.tag_css(tag)[0]
|
||||
if (css.has_key('display') and css['display'].lower() == 'none') or \
|
||||
(css.has_key('visibility') and css['visibility'].lower() == 'hidden'):
|
||||
return ''
|
||||
text = u''
|
||||
for c in tag.contents:
|
||||
if limit != None and len(text) > limit:
|
||||
break
|
||||
if isinstance(c, HTMLConverter.IGNORED_TAGS):
|
||||
return u''
|
||||
if isinstance(c, NavigableString):
|
||||
text += unicode(c)
|
||||
elif isinstance(c, Tag):
|
||||
if c.name.lower() == 'img' and c.has_key('alt'):
|
||||
text += c['alt']
|
||||
return text
|
||||
text += self.get_text(c)
|
||||
return text
|
||||
|
||||
def process_links(self):
|
||||
def add_toc_entry(text, target):
|
||||
|
Loading…
x
Reference in New Issue
Block a user