diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-23 10:46:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-23 10:46:06 +0000 |
commit | d011ffae9b6ac96eccec8dfa1493f37cf4d66ff6 (patch) | |
tree | 7537928c1bde805b3bf3b70d96e3e014cbe360f8 /lib/Pod | |
parent | 455ece5e082708b1bd94cff001612bd4efb4d2e9 (diff) | |
download | perl-d011ffae9b6ac96eccec8dfa1493f37cf4d66ff6.tar.gz |
make Pod/Html.pm handle the --title option properly (as suggested
by gml4410@ggr.co.uk)
p4raw-id: //depot/perl@1853
Diffstat (limited to 'lib/Pod')
-rw-r--r-- | lib/Pod/Html.pm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 5d2e07b2af..2a90e1d8a5 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -300,18 +300,20 @@ sub pod2html { open(HTML, ">$htmlfile") || die "$0: cannot open $htmlfile file for output: $!\n"; - # put a title in the HTML file - $title = ''; - TITLE_SEARCH: { - for (my $i = 0; $i < @poddata; $i++) { - if ($poddata[$i] =~ /^=head1\s*NAME\b/m) { - for my $para ( @poddata[$i, $i+1] ) { - last TITLE_SEARCH if ($title) = $para =~ /(\S+\s+-+.*\S)/s; - } - } + # put a title in the HTML file if one wasn't specified + if ($title eq '') { + TITLE_SEARCH: { + for (my $i = 0; $i < @poddata; $i++) { + if ($poddata[$i] =~ /^=head1\s*NAME\b/m) { + for my $para ( @poddata[$i, $i+1] ) { + last TITLE_SEARCH + if ($title) = $para =~ /(\S+\s+-+.*\S)/s; + } + } - } - } + } + } + } if (!$title and $podfile =~ /\.pod$/) { # probably a split pod so take first =head[12] as title for (my $i = 0; $i < @poddata; $i++) { |