Fix non XML safe characters in feed descriptions causing news download to fail. Fixes #1707545 [News Resource download not working..National Review Online](https://bugs.launchpad.net/calibre/+bug/1707545)

This commit is contained in:
Kovid Goyal 2017-07-31 19:57:00 +05:30
parent 790b8273a7
commit bf5867e380
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -164,7 +164,7 @@ class FeedTemplate(Template):
),
CLASS('calibre_feed_image')))
if getattr(feed, 'description', None):
d = DIV(feed.description, CLASS('calibre_feed_description',
d = DIV(clean_xml_chars(feed.description), CLASS('calibre_feed_description',
'calibre_rescale_80'))
d.append(BR())
div.append(d)
@ -284,6 +284,7 @@ class TouchscreenIndexTemplate(Template):
class TouchscreenFeedTemplate(Template):
def _generate(self, f, feeds, cutoff, extra_css=None, style=None):
from calibre.utils.cleantext import clean_xml_chars
def trim_title(title,clip=18):
if len(title)>clip:
@ -353,7 +354,7 @@ class TouchscreenFeedTemplate(Template):
),
CLASS('calibre_feed_image')))
if getattr(feed, 'description', None):
d = DIV(feed.description, CLASS('calibre_feed_description',
d = DIV(clean_xml_chars(feed.description), CLASS('calibre_feed_description',
'calibre_rescale_80'))
d.append(BR())
div.append(d)