Pod::Html, which ships with the core, breaks on things like

L<PerlMonks|http://www.perlmonks.org/>

...with an error message like

C:\STRAWB~1\perl\bin/pod2html.bat: ../test.pod: cannot resolve L<PerlM +onks|http://www.perlmonks.org/> in paragraph 6.

This is not unique or new, as evidenced by hyperlinks in pod and others.

I still use 5.12.3 (too lazy to reinstall all the modules I've accumulated), so I decided to patch the module so it does accept the URLs by putting together two other expressions.
In v1.09 (the latest version of its kind), around line 1605, add this snippet after the if block:

# some L<>'s that shouldn't be: # a) full-blown URL's are emitted as-is if( $par =~ m{^\w+://}s ){ return make_URL_href( $par ); } # --- add this: --- elsif( $par =~ m{^([^|]+)\|(\w+)://(.+)}s ) { #link text in $1, scheme in $2, everything else in $3 return sprintf '<a href="%s://%s">%s</a>', $2, $3, html_escape($1) +; }

It might not work in all cases, but it seems to work for everything I could think of.

Pod::Html was replaced with a Pod::Simple solution in v5.16.0 (as evidenced by perl5160delta), but if you use something older like I do, and you've run into this frustration, it might save you the bother of having to rewrite a bunch of code to use something else.

Bonus: Make the output more XHTML compliant

The output may say that it's XHTML-1.0 compliant, but this is not the case. One example that bothers XML parsers is that the <dt> tags aren't closed all the time. For example, when you have...

=over 1 =item bla asdfghjk =back

... the resulting dt is closed as you would expect. But when you have...

=over 1 =item sdfsfgsdh =back

...it just outputs a blank, unclosed dt tag (followed by a dd tag with the text in it, as expected). To fix this, change this part around line 1211:

if ($text =~ /\A(.+)\Z/s ){ # should have text emit_item_tag( $otext, $text, 1 ); # write the definition term and close <dt> tag print HTML "</dt>\n"; }

to this:

if ($text =~ /\A(.+)\Z/s ){ # should have text emit_item_tag( $otext, $text, 1 ); } # write the definition term and close <dt> tag print HTML "</dt>\n";
-Thomas
"Excuse me for butting in, but I'm interrupt-driven..."

In reply to Support for URLs with link titles in Pod::Html by thomas895

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.