mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix handling of description in feeds
This commit is contained in:
parent
b187f4d46b
commit
c16132eba6
@ -105,7 +105,6 @@ class DefaultProfile(object):
|
|||||||
def build_index(self):
|
def build_index(self):
|
||||||
'''Build an RSS based index.html'''
|
'''Build an RSS based index.html'''
|
||||||
articles = self.parse_feeds()
|
articles = self.parse_feeds()
|
||||||
|
|
||||||
|
|
||||||
def build_sub_index(title, items):
|
def build_sub_index(title, items):
|
||||||
ilist = ''
|
ilist = ''
|
||||||
@ -300,7 +299,7 @@ class DefaultProfile(object):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def process_html_description(cls, tag, strip_links=True):
|
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())
|
match = cls.CDATA_PAT.match(src.lstrip())
|
||||||
if match:
|
if match:
|
||||||
src = match.group(1)
|
src = match.group(1)
|
||||||
@ -311,6 +310,7 @@ class DefaultProfile(object):
|
|||||||
src = src.replace(ent, unichr(name2codepoint[e]))
|
src = src.replace(ent, unichr(name2codepoint[e]))
|
||||||
if strip_links:
|
if strip_links:
|
||||||
src = re.compile(r'<a.*?>(.*?)</a>', re.IGNORECASE|re.DOTALL).sub(r'\1', src)
|
src = re.compile(r'<a.*?>(.*?)</a>', re.IGNORECASE|re.DOTALL).sub(r'\1', src)
|
||||||
|
|
||||||
return src
|
return src
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user