mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 14:33:31 +02:00
Fix handling of description in feeds
This commit is contained in:
parent
b187f4d46b
commit
c16132eba6
1 changed files with 2 additions and 2 deletions
|
|
@ -105,7 +105,6 @@ def __init__(self, logger, verbose=False, username=None, password=None):
|
|||
def build_index(self):
|
||||
'''Build an RSS based index.html'''
|
||||
articles = self.parse_feeds()
|
||||
|
||||
|
||||
def build_sub_index(title, items):
|
||||
ilist = ''
|
||||
|
|
@ -300,7 +299,7 @@ def cleanup(self):
|
|||
|
||||
@classmethod
|
||||
def process_html_description(cls, tag, strip_links=True):
|
||||
src = '\n'.join(tag.contents)
|
||||
src = '\n'.join(tag.contents) if hasattr(tag, 'contents') else tag
|
||||
match = cls.CDATA_PAT.match(src.lstrip())
|
||||
if match:
|
||||
src = match.group(1)
|
||||
|
|
@ -311,6 +310,7 @@ def process_html_description(cls, tag, strip_links=True):
|
|||
src = src.replace(ent, unichr(name2codepoint[e]))
|
||||
if strip_links:
|
||||
src = re.compile(r'<a.*?>(.*?)</a>', re.IGNORECASE|re.DOTALL).sub(r'\1', src)
|
||||
|
||||
return src
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue