dvschultz / 99problems

99 Problems and e-reader rendering are all of them
60 stars 3 forks source link

kindlegen parses css incorrectly #50

Open gimsieke opened 8 years ago

gimsieke commented 8 years ago

This CSS:

.appendix .hidden {
  display: none;
}

gives the message:

Error(parsing):E3013: More number of characters are hidden using 
display:none than allowed limit. Limit: 10000 in File: … line 8

when there is a div.appendix with more than 10,000 characters.

kindlegen 2.9 apparently stops parsing the selector at the first space. The selector pertains to some .hidden element within an .appendix element, and there was none such. kindlegen erroneously assumed that it applied to any .appendix. If that’s the quality of their CSS parsing also for display then good luck with reproducing your fancy layout on the Kindle.

Removing the rule or changing the selector to, for example, .appendix.hidden, let the message disappear.

It’s frustrating when customers ask us to fix stuff that we didn’t cause and that isn’t problematic at all in the first place.

tooolbox commented 8 years ago

Yes, Kindlegen treats the selector .appendix .hidden as .appendix, .hidden which has some awkward results. I'd never seen the "hidden character limit" before.

I wrote a Javascript module that simplifies your CSS to levels that Kindlegen can easily use, which you can find here: https://github.com/allscribe/allscribe. It's not well-documented, and you have to be a programmer to use it, but the hard work has been done.

dauwhe commented 5 years ago

Here we are, three years, later, and this bug still exists.