Catalog generation: Ignore tags with commas in them when generating genres

This commit is contained in:
Kovid Goyal 2017-03-17 12:00:15 +05:30
parent 56adb9c679
commit 93157d253d

View File

@ -2698,7 +2698,10 @@ class CatalogBuilder(object):
for (i, tag) in enumerate(sorted(book.get('genres', []))):
aTag = Tag(_soup, 'a')
if self.opts.generate_genres:
aTag['href'] = "Genre_%s.html" % self.genre_tags_dict[tag]
try:
aTag['href'] = "Genre_%s.html" % self.genre_tags_dict[tag]
except KeyError:
pass
aTag.insert(0, escape(NavigableString(tag)))
genresTag.insert(gtc, aTag)
gtc += 1