fix PodParser testsuite; Pod::Text subsumes Pod::PlainText
[p5sagit/p5-mst-13.2.git] / lib / Pod / Html.pm
index 6077291..e9c640c 100644 (file)
@@ -190,8 +190,9 @@ This program is distributed under the Artistic License.
 
 =cut
 
-my $dircache = "pod2html.d~~";
-my $itemcache = "pod2html.i~~";
+my $cache_ext = $^O eq 'VMS' ? ".tmp" : ".x~~";
+my $dircache = "pod2htmd$cache_ext";
+my $itemcache = "pod2htmi$cache_ext";
 
 my @begin_stack = ();          # begin/end stack
 
@@ -243,8 +244,8 @@ my %items = ();                     # associative array used to find the location
 my $Is83;                       # is dos with short filenames (8.3)
 
 sub init_globals {
-$dircache = "pod2html.d~~";
-$itemcache = "pod2html.i~~";
+$dircache = "pod2htmd$cache_ext";
+$itemcache = "pod2htmi$cache_ext";
 
 @begin_stack = ();             # begin/end stack
 
@@ -345,8 +346,7 @@ sub pod2html {
     my $index = scan_headings(\%sections, @poddata);
 
     unless($index) {
-       warn "No pod in $podfile\n" if $verbose;
-       return;
+       warn "No headings in $podfile\n" if $verbose;
     }
 
     # open the output file
@@ -421,7 +421,7 @@ END_OF_HEAD
     print HTML $index;
     print HTML "-->\n" unless $doindex;
     print HTML "<!-- INDEX END -->\n\n";
-    print HTML "<HR>\n" if $doindex;
+    print HTML "<HR>\n" if $doindex and $index;
 
     # now convert this file
     warn "Converting input file\n" if $verbose;
@@ -1506,7 +1506,8 @@ sub process_L {
        $link = "#" . htmlify(0,$section);
        $linktext = $section unless defined($linktext);
     } elsif ( $page =~ /::/ ) {
-       $linktext  = ($section ? "$section" : "$page");
+       $linktext  = ($section ? "$section" : "$page")
+           unless defined($linktext);
        $page =~ s,::,/,g;
        # Search page cache for an entry keyed under the html page name,
        # then look to see what directory that page might be in.  NOTE: