Thanks to all for appreciation and testing!
Yes, a trailing comma seems to be a syntax error (and in my Sigil's Preview and in Calibre's ebook-viewer the associated rule doesn't work). Good to know that the problem is solved and the plugin works as expected.
Nonetheless, I'd like to lessen some rigidities of the css parser, but cssutils is a convoluted package, so it's not a simple matter.
One issue, for example, is that it doesn't recognize Amazon's media queries for kindlegen ("@media amzn-mobi" and "@media amzn-kf8"): the accepted values are those of MEDIA_TYPE list in cssutils/stylesheets/mediaquery.py. I added the two values directly there and everything seems to work fine, but I don't know how to integrate that little change in my plugin without subclassing a large number of cssutils's classes and copying probably hundreds of lines of code.
KevinH and DiapDealer, is there a chance to have a sigil-cssutils (as you already did with sigil-bs4) in some future release of Sigil?
|