mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
10196dd923
commit
44129f0d1f
@ -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)
|
||||||
|
@ -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])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user