mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-04 08:33:07 +02:00
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:
parent
790b8273a7
commit
bf5867e380
1 changed files with 3 additions and 2 deletions
|
|
@ -164,7 +164,7 @@ def _generate(self, f, feeds, cutoff, extra_css=None, style=None):
|
|||
),
|
||||
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 @@ def _generate(self, title, masthead, datefmt, feeds, extra_css=None, style=None)
|
|||
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 @@ def trim_title(title,clip=18):
|
|||
),
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue