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.
This commit is contained in:
Kovid Goyal 2022-07-31 20:04:41 +05:30
parent d130d81319
commit 6535d9acd2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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: