I've started seeing this just recently, so I'm not sure if something's changed with new Calibre releases, I'm doing something different, and/or I've lost my mind. If I run Modify ePub (v 1.7.3) against an epub3 book in Calibre 6.4, the @page class in stylesheet.css gets messed up. First, Calibre adds that @page thing during conversion, but I modified it slightly to include a comment. Here's what it looks like now:
Code:
@page {
/* Basic Styling for what passes for pages in an epub */
margin-top: 0;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
}
If I run Modify ePub against a book with that in it, afterwards that @page class will look like this:
Code:
@page { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0;/* Basic Styling for what passes for pages in an epub */
margin-top: 0 }
The log for that run looks like:
Code:
Modify ePubs version (1, 7, 3)
Logfile for book ID 285 (My Test Book - 0 Margins / me)
Job details 285
Modifying: C:\Users\Dave\AppData\Local\Temp\calibre_g_x6det9\mwzd7iwe_modify_epub\285.epub
Updating metadata and cover
Parsing xml file: content.opf
Parsing xml file: toc.ncx
Looking for redundant entries in manifest
Looking for unmanifested files
Looking for broken links in the NCX
ncx name: toc.ncx
Looping over ncx entries
Looking for Adobe xpgt files and links to remove
Looking for pagemaps
Looking for Google Play pagemaps
Looking for Adobe DRM meta tags to remove
Looking for legacy jackets
Adding or updating jacket
Current jacket removed: jacket.xhtml
Manifest item removed: jacket.xhtml (calibre_jacket)
Spine itemref removed: calibre_jacket
Manifest item added: jacket.xhtml (calibre_jacket)
Spine item inserted: calibre_jacket at pos: 1
Looking for html pages containing only broken image links
Looking for non dc: elements in manifest
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Removing child: {http://www.idpf.org/2007/opf}meta
Looking for html files to remove charset meta tags/encode to utf-8
Looking for embedded fonts
Looking for css @font-face style declarations
Looking for inline @font-face style declarations
Looking for CSS margins
Modified inline CSS margins in: margintest.xhtml
Modified CSS margins in: stylesheet.css
Looking for inline javascript blocks to remove
Looking for .js files to remove
Applying smarten punctuation
Stripping Kobo remnants
Looking for files to remove: ['iTunesMetadata.plist', 'iTunesArtwork']
Looking for files to remove: ['META-INF/calibre_bookmarks.txt']
Found file to remove: META-INF/calibre_bookmarks.txt
Looking for files to remove: ['.DS_Store', 'thumbs.db']
Looking for unused images
Stripping spans
Unprettying files
ePub updated in 0.07 seconds
To me, it looks like Modify ePub is recreating all the @page margin settings and then appending my comment and the first of my margin settings to that. I don't know why. If it were just cosmetics, that'd be no problem. But, Calibre's Check Book function doesn't like the duplicate margin-top at all.
Unfortunately, with chaley's comment a couple of pages back that he doesn't really maintain this any more, and with davidfor's recent passing (it looks like he did some work with the PI), I'm not sure if anyone can fix this. But, I'd appreciate it if someone would run the PI and check their @page class before and after.