From 6535d9acd2c122982759247a50766da74f5457f4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 31 Jul 2022 20:04:41 +0530 Subject: [PATCH] E-book viewer: Speed up initial render of books with lots of CSS by not prettying the CSS Also works around a bug in css-parser where prettying certain types of stylesheets breaks them. --- src/calibre/srv/render_book.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/calibre/srv/render_book.py b/src/calibre/srv/render_book.py index 2ae0e05c67..1bf0ecad9a 100644 --- a/src/calibre/srv/render_book.py +++ b/src/calibre/srv/render_book.py @@ -26,7 +26,6 @@ from calibre.ebooks.oeb.polish.container import Container as ContainerBase from calibre.ebooks.oeb.polish.cover import ( find_cover_image, find_cover_image_in_page, find_cover_page ) -from calibre.ebooks.oeb.polish.pretty import pretty_script_or_style from calibre.ebooks.oeb.polish.toc import from_xpaths, get_landmarks, get_toc from calibre.ebooks.oeb.polish.utils import guess_type from calibre.ptempfile import PersistentTemporaryDirectory @@ -334,7 +333,6 @@ def transform_inline_styles(container, name, transform_sheet, transform_style): if nraw != style.text: changed = True style.text = nraw - pretty_script_or_style(container, style) for elem in root.xpath('//*[@style]'): text = elem.get('style', None) if text: