mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-05 08:40:13 -04:00
lwn_weekly: Prevents fail if article title is not defined.
More resilient behavior if article title contains non-html-encoded characters. E.g. "<Programming>" string in the title start is recognized by beatiful soup as html tag, but it is not, making the title a NoneType, and raising an exception on Article creation. This is actually a bug in the news page itself, but it anyways breaks the recipe; hence, adding here a fixed string if for any reason the article title end up with a NoneType.
This commit is contained in:
parent
29de031ff1
commit
7a5c16fdc0
@ -104,6 +104,8 @@ class WeeklyLWN(BasicNewsRecipe):
|
||||
|
||||
elif 'SummaryHL' in curr.attrMap['class']:
|
||||
article_title = text
|
||||
if not article_title:
|
||||
article_title = _('Undefined article title')
|
||||
|
||||
if subsection:
|
||||
section_title = "%s: %s" % (section, subsection)
|
||||
|
Loading…
x
Reference in New Issue
Block a user