From 50a4a0294cd73629b6f6e54b20fe89eff66beb22 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 24 Mar 2012 01:45:15 +0530 Subject: [PATCH] E-book viewer: Workaround for EPUB files with self closing title tags in their HTML. Fixes #962908 (Epub with viewing problems) --- src/calibre/gui2/viewer/documentview.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py index 3dee673150..11f2c61427 100644 --- a/src/calibre/gui2/viewer/documentview.py +++ b/src/calibre/gui2/viewer/documentview.py @@ -709,6 +709,7 @@ class DocumentView(QWebView): # {{{ if self.manager is not None: self.manager.load_started() self.loading_url = QUrl.fromLocalFile(path) + html = re.sub(r'<\s*title\s*/\s*>', '', html, flags=re.IGNORECASE) if has_svg: self.setContent(QByteArray(html.encode(path.encoding)), mt, QUrl.fromLocalFile(path)) else: