fix issue with books missing titles

gutenberg1
eric 2020-08-27 17:59:16 -04:00
parent 97961ea4f8
commit 1e9e1593d0
1 changed files with 7 additions and 4 deletions

View File

@ -39,10 +39,13 @@ class CoverPages(object):
for row in rows:
url = '/' + row.filename
href = '/ebooks/%d' % row.pk
title = gg.xmlspecialchars (row.title) # handles <,>,&
#Shortening long titles for latest covers
title = title.replace('"', '&quot;')
title = title.replace("'", '&apos;')
if row.title:
title = gg.xmlspecialchars (row.title) # handles <,>,&
#Shortening long titles for latest covers
title = title.replace('"', '&quot;')
title = title.replace("'", '&apos;')
else:
title = '!! missing title !!'
short_title = title
title_len = len(title)
short_title = re.sub(r"\-+", " ", short_title)