CSS stripped in Mobi-to-Mobi conversion

Bug #1157345 reported by Sanders Kleinfeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

When I do a Mobi-to-Mobi conversion via Calibre v0.9.23 on Mac OS X, all the CSS embedded in the source Mobi file appears to be stripped out of the output Mobi file. Can the source CSS be preserved in the output Mobi?

Related branches

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1157345

You need to convert to azw3.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Sanders Kleinfeld (sanders-t) wrote :

Hi Kovid,

I did try converting to azw3 as well, and I experienced the same error. I'm attaching a .zip of two files to this ticket: original.mobi is my original Mobi file (a KF8 file produced from EPUB with KindleGen 2.7), and converted.azw3 is the azw3 file output by converting the original Mobi Calibre. All the KF8 styling is gone in the azw3 file--perhaps because I'm using an amzn-kf8 @media querly?

Let me know if I can provide any more information that would be of help.

Thanks,
Sanders

Revision history for this message
Kovid Goyal (kovid) wrote :

I'll take a detailed look later, but note that you cannot put @ rules
like @font-face inside a @media rule. See
http://www.w3.org/TR/CSS21/media.html#at-media-rule

Revision history for this message
Kovid Goyal (kovid) wrote :

The problem was indeed the @media rule (calibre supports specifying the
media via the <html> link tag, but not inside the css itself). I've added
support for @media rules in the css.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in lp:calibre

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
Revision history for this message
Sanders Kleinfeld (sanders-t) wrote :

Thank you very much, Kovid. Appreciate the quick response and bug fix.

Best,
Sanders

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.