mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:14:07 +02: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
1 changed files with 2 additions and 0 deletions
|
|
@ -104,6 +104,8 @@ def parse_index(self):
|
|||
|
||||
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…
Reference in a new issue