diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index 2554d91f15..8eeff46d79 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -32,7 +32,6 @@ from calibre.ebooks.lrf.html.table import Table from calibre import filename_to_utf8, setup_cli_handlers, __appname__, \ fit_image, LoggingInterface, preferred_encoding from calibre.ptempfile import PersistentTemporaryFile -from calibre.ebooks.metadata.opf import OPFReader from calibre.devices.interface import Device from calibre.ebooks.lrf.html.color_map import lrs_color from calibre.ebooks.chardet import xml_to_unicode @@ -106,6 +105,8 @@ class HTMLConverter(object, LoggingInterface): (re.compile(r'()', re.IGNORECASE|re.DOTALL), strip_style_comments), + # Remove self closing script tags as they also mess up BeautifulSoup + (re.compile(r'(?i)]+?/>'), lambda match: ''), ] # Fix Baen markup @@ -334,7 +335,8 @@ class HTMLConverter(object, LoggingInterface): soup = BeautifulSoup(raw, convertEntities=BeautifulSoup.XHTML_ENTITIES, markupMassage=nmassage) - + else: + raise if not self.baen and self.is_baen(soup): self.baen = True self.log_info(_('\tBaen file detected. Re-parsing...')) diff --git a/src/calibre/ebooks/lrf/pylrs/pylrs.py b/src/calibre/ebooks/lrf/pylrs/pylrs.py index 081c5a5179..60f8d21336 100644 --- a/src/calibre/ebooks/lrf/pylrs/pylrs.py +++ b/src/calibre/ebooks/lrf/pylrs/pylrs.py @@ -1432,7 +1432,7 @@ class Page(LrsObject, LrsContainer): #print "page contents:", pageContent # ObjectList not needed and causes slowdown in SONY LRF renderer - p.appendLrfTag(LrfTag("ObjectList", pageContent)) + #p.appendLrfTag(LrfTag("ObjectList", pageContent)) p.appendLrfTag(LrfTag("Link", self.pageStyle.objId)) p.appendLrfTag(LrfTag("ParentPageTree", lrfWriter.getPageTreeId())) p.appendTagDict(self.settings) diff --git a/src/calibre/utils/lzx/lzc.c b/src/calibre/utils/lzx/lzc.c index 0709714d81..4466e5a575 100644 --- a/src/calibre/utils/lzx/lzc.c +++ b/src/calibre/utils/lzx/lzc.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #ifdef DEBUG_PERF #include