hillu
hillu

Reputation: 9611

What is the correct syntax for producing http links with custom text with pod2html?

The perlpod documentation tells me that I can link to URLs using L<scheme:...> or L<text|scheme:...>, it even lists L<The Perl Home Page|http://www.perl.org/> as an example.

The first case works fine for me: pod2html turns

L<http://example.com/>

into

<a href="http://example.com/">http://example.com/</a>

But it fails on

L<example|http://example.com/>

which is just turned into

<em>example</em>

along with a warning:

/usr/bin/pod2html: : cannot resolve L<example|http://example.com/> in paragraph 2.

I would have expected something like

<a href="http://example.com/">example</a>

to be produced. How can I achieve that?

UPDATE So this seems to be a bug in Pod::Html as Alan Haggai Alavi points out. Is there a workaround?

Upvotes: 4

Views: 532

Answers (2)

Alan Haggai Alavi
Alan Haggai Alavi

Reputation: 74252

It indeed was a bug in Pod::Html. It has been fixed in bleadperl.

Now L<example|http://example.com/> gets converted to <a href="http://example.com/">example</a>.

Since Pod::Html is a pure Perl module, the files can be copied from bleadperl which will give you version 1.12. The module shipped with with perlv5.14.2 is version 1.11 and exhibits this bug.

Else, you can use Pod::Simple::Html which works as expected.

Upvotes: 7

yb007
yb007

Reputation: 1377

use it like

L<< example|http://example.com/ >>

Upvotes: -1

Related Questions