Fix #4653 (Typo in metadata for new quick start guide) and strip img tags with src=# in epub output as they cause ADE to freeze

This commit is contained in:
Kovid Goyal 2010-01-23 11:53:24 -07:00
parent 10196dd923
commit 44129f0d1f
2 changed files with 3 additions and 2 deletions

View File

@ -268,7 +268,8 @@ class EPUBOutput(OutputFormatPlugin):
# remove <img> tags with empty src elements # remove <img> tags with empty src elements
bad = [] bad = []
for x in XPath('//h:img')(body): for x in XPath('//h:img')(body):
if not x.get('src', '').strip(): src = x.get('src', '').strip()
if src in ('', '#'):
bad.append(x) bad.append(x)
for img in bad: for img in bad:
img.getparent().remove(img) img.getparent().remove(img)

View File

@ -522,7 +522,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.metadata import MetaInformation
mi = MetaInformation(_('Calibre Quick Start Guide'), ['John Schember']) mi = MetaInformation(_('Calibre Quick Start Guide'), ['John Schember'])
mi.author_sort = 'Schember, John' mi.author_sort = 'Schember, John'
mi.comments = "A guide to get you up an running with calibre" mi.comments = "A guide to get you up and running with calibre"
mi.publisher = 'calibre' mi.publisher = 'calibre'
self.library_view.model().add_books([P('quick_start.epub')], ['epub'], self.library_view.model().add_books([P('quick_start.epub')], ['epub'],
[mi]) [mi])