Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ol> generates items called 65535 or no numbering #34

Open
szabgab opened this issue Sep 17, 2015 · 2 comments
Open

<ol> generates items called 65535 or no numbering #34

szabgab opened this issue Sep 17, 2015 · 2 comments

Comments

@szabgab
Copy link
Contributor

szabgab commented Sep 17, 2015

use 5.010;
use strict;
use warnings;

use EBook::MOBI;
my $book = EBook::MOBI->new();

$book->add_mhtml_content(q{
<p>&lt;ol&gt; and &lt;li&gt; oddly number the rows with 65535.</p>
<ol>
  <li>First entry</li>
  <li>Second entry</li>
</ol>
}
);

$book->add_pagebreak();

$book->set_title( 'A new MOBI book generated by EBook::MOBI' );
$book->set_author('Gabor Szabo');
$book->set_encoding(':encoding(UTF-8)');
$book->print_mhtml;

$book->make();
$book->save();

The resulting file will show two list items having the order number 65535 when viewed on the desktop Kindle reader on OSX.
When reading on real Kindle, they show no numbering at all.

I wonder if this is a bug in the module, the viewer or Kindle itself?

I wonder if this

@borisdaeppen
Copy link
Owner

Hi Gabor,

I made this module once without much deeper understanding of the kindle-format (due to the lack of solutions on CPAN).
I just wrapped existing scripts into a module and did some reverse engineering until it worked.
I can't help you here.
If you find the problem, I can merge any fixes.

Perhaps I messed something up in the code from add_mhtml_content?
Maybe also the method "debug_on" helps https://metacpan.org/pod/EBook::MOBI#debug_on
As far I remember I was able to print out the compete data-structure (html) before it gets compressed into the mobi-format.
If the raw data structure also shows this behavior, something in the code is messed up!

Sorry!
Boris

@szabgab
Copy link
Contributor Author

szabgab commented Sep 24, 2015

I am really glad this module exists so I can create MOBI files.
I'll try to see if I can have a patch for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants