View Single Post
Old 07-28-2012, 01:59 PM   #30
olig
Enthusiast
olig began at the beginning.
 
Posts: 32
Karma: 12
Join Date: Jul 2012
Device: Kindle 4nt 4.1.3 jailbreak
Ok. It works, but I need to do some more tests, with different paragraph mixes, to be sure to catch all cases.

BTW: While doing my tests the most annoying thing where lots of 'Unknown' lines in the MOBI conversions. Line 318 in ebooks/mobi/utils.py is the reason that every empty paragraph in my source gets replaced by 'Unknown'. Well, at least this beasts does the replace, there as to be a place that calls this for every string. Perhaps there should a switch for this so that Unknown is only replaced for meaningful tags like title?

Edit: it's the call to utf8_text in ebooks/mobi/writer2/serializer.py:383

Edit 2: As I read the commit that changed this (#12785), it is not about empty strings, but only about accented characters. So perhaps the best solution would be to add a empty keyword to the utf8_text that defaults to False and depending the replace with Unknown on this.

Edit 3: Fixed this in my branch with rev 12795.

Last edited by olig; 07-28-2012 at 02:36 PM.
olig is offline   Reply With Quote