From 44129f0d1f083988e79e532d3cac637aac3fa141 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Jan 2010 11:53:24 -0700 Subject: [PATCH] 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 --- src/calibre/ebooks/epub/output.py | 3 ++- src/calibre/gui2/ui.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index bffc24ac91..8e9c9efea9 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -268,7 +268,8 @@ class EPUBOutput(OutputFormatPlugin): # remove tags with empty src elements bad = [] for x in XPath('//h:img')(body): - if not x.get('src', '').strip(): + src = x.get('src', '').strip() + if src in ('', '#'): bad.append(x) for img in bad: img.getparent().remove(img) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index b132e368ee..714b2c3a27 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -522,7 +522,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): from calibre.ebooks.metadata import MetaInformation mi = MetaInformation(_('Calibre Quick Start Guide'), ['John Schember']) 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' self.library_view.model().add_books([P('quick_start.epub')], ['epub'], [mi])