What is the correct syntax for creating custom text http links using 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 turn

 L<http://example.com/> 

in

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

But he fails on

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

which just turns into

 <em>example</em> 

along with a warning:

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

I would expect something like

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

. How can i achieve this?

UPDATE . So it seems that this is a mistake in Pod::Html , as Alan Haggai Alawi points out. Is there a workaround?

+4
source share
2 answers

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

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

Since Pod::Html is a pure Perl module, files can be copied from the bleadperl file , which will give you version 1.12. The module shipped with perl v5.14.2 has version 1.11 and demonstrates this error.

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

+7
source

use it like

 L<< example|http://example.com/ >> 
-1
source

Source: https://habr.com/ru/post/1385763/


All Articles