Skip to content
This repository

Unprocessed Links in Mobi Format #20

Closed
mgatto opened this Issue June 17, 2012 · 5 comments

2 participants

Michael Gatto Boris Däppen
Michael Gatto
mgatto commented June 17, 2012

In the CHI Mobi ebook I got from perlybook, there are many strings which seem like they ought to be links but are probably still in pod format, as such (I'm no expert on POD):

CHI::Driver::File|File

This pattern occurs in many places.

Boris Däppen
Collaborator

Thanks for reporting.

An example found in the book:

Keys over this size will be digested|key_digester. The default is driver-specific; CHI::Driver::File|File, for example, defaults this to 240 due to file system limits. For most drivers there is no maximum.

I will have a look on that.

Boris Däppen
Collaborator

Does not appear in EPUB, so it is probably an issue of EBook::MOBI

Boris Däppen
Collaborator

Tanks @mgatto for telling us this issue.
EBook::MOBI did not handle "enhanced" use of the L<> tag in POD - so this was the cause.

I added some support for it in commit 6a776af.
See borisdaeppen/EBook--MOBI@6a776af for details.

The testcases show how it behaves now:

$pod_input{inline_links} = <<'HEREDOC';
=head1 Inline Links

Link 1 L<Module>

Link 2 L<Module/Chapter>

Link 3 L<Name|Module>

Link 4 L<Name|Module/Chapter>

Link 5 L<Name|/Chapter>

Link 6 L</Chapter>

Link 7 L<http://perl.org>

Link 8 L<perl.org>

Link 9 L<Perl|http://perl.org>

Link 10 L<Perl|perl.org>

=cut
HEREDOC

$html_out{inline_links} = <<'HEREDOC';
<body>
<h1>Inline Links</h1>
<p>Link 1 <a href='https://metacpan.org/module/Module'>Module</a></p>
<p>Link 2 <a href='https://metacpan.org/module/Module#Chapter'>Module/Chapter</a></p>
<p>Link 3 <a href='https://metacpan.org/module/Module'>Name</a></p>
<p>Link 4 <a href='https://metacpan.org/module/Module#Chapter'>Name</a></p>
<p>Link 5 Name (Chapter)</p>
<p>Link 6 "Chapter"</p>
<p>Link 7 <a href='http://perl.org'>http://perl.org</a></p>
<p>Link 8 <a href='perl.org'>perl.org</a></p>
<p>Link 9 <a href='http://perl.org'>Perl</a></p>
<p>Link 10 <a href='perl.org'>Perl</a></p>
</body>
HEREDOC

I'm sure this is not yet perfect but it is much better as before...

As soon as EBook-MOBI-0.45 is spread on CPAN I'll install it on perlybook.org

Boris Däppen
Collaborator
Boris Däppen borisdaeppen closed this June 20, 2012
Michael Gatto
mgatto commented June 25, 2012

That's great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.