From 64cb14a094bf56b192200aa673471057a1f079c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Feb 2014 08:21:33 +0530 Subject: [PATCH] EPUB Output: If the output profile is set to one of the Nook profiles, do not use shorthand CSS properties as the Nook cannot handle them. --- src/calibre/ebooks/conversion/plugins/oeb_output.py | 5 ++++- src/calibre/ebooks/conversion/plumber.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/oeb_output.py b/src/calibre/ebooks/conversion/plugins/oeb_output.py index 114bcadfc1..25c4bbc052 100644 --- a/src/calibre/ebooks/conversion/plugins/oeb_output.py +++ b/src/calibre/ebooks/conversion/plugins/oeb_output.py @@ -54,7 +54,10 @@ class OEBOutput(OutputFormatPlugin): f.write(raw) for item in oeb_book.manifest: - if not self.opts.expand_css and item.media_type in OEB_STYLES and hasattr(item.data, 'cssText'): + if ( + not self.opts.expand_css and + item.media_type in OEB_STYLES and hasattr(item.data, 'cssText') and + 'nook' not in self.opts.output_profile.short_name): condense_sheet(item.data) path = os.path.abspath(unquote(item.href)) dir = os.path.dirname(path) diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index 6edef139e7..cb49801328 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -368,7 +368,10 @@ OptionRecommendation(name='expand_css', help=_( 'By default, calibre will use the shorthand form for various' ' css properties such as margin, padding, border, etc. This' - ' option will cause it to use the full expanded form instead.') + ' option will cause it to use the full expanded form instead.' + ' Note that CSS is always expanded when generating EPUB files' + ' with the output profile set to one of the Nook profiles' + ' as the Nook cannot handle shorthand CSS.') ), OptionRecommendation(name='page_breaks_before',