From: Unknown Contributor Date: Mon, 5 May 1997 22:28:06 +0000 (+0200) Subject: Three bugs in pod2html X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be173d55224d502f8f43b651987d3769cef41280;p=p5sagit%2Fp5-mst-13.2.git Three bugs in pod2html I had three problems with the pod2html distributed with perl 5.00399: 1. The HTML code generated begins with a series of hyperlinks to all sections of the file. Pod directives occurring in the section titles (=head directives) were not translated. 2. C sets translates to foo -- the () disappear. 3. Perlpod promises that example code gets typeset with tab stops every 8 columns. HTML makes no such promise, hence pod2html must expand tabs. The first three hunks of the patch below solve #1, hunk 4 fixes a call to &process_text with the wrong number of args, hunk 5 solves #3 and hunk 6 solves #2.x p5p-msgid: 199705052228.AAA25351@mail.euronet.nl --- diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index a00d210..aaefc3c 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -712,6 +712,10 @@ sub scan_headings { my($sections, @data) = @_; my($tag, $which_head, $title, $listdepth, $index); + # here we need local $ignore = 0; + # unfortunately, we can't have it, because $ignore is lexical + $ignore = 0; + $listdepth = 0; $index = ""; @@ -732,7 +736,8 @@ sub scan_headings { $listdepth = $which_head; $index .= "\n" . ("\t" x $listdepth) . "
  • " . - "$title"; + "" . + process_text(\$title, 0) . ""; } } @@ -744,6 +749,8 @@ sub scan_headings { # get rid of bogus lists $index =~ s,\t*
      \s*
    \n,,g; + $ignore = 1; # retore old value; + return $index; } @@ -803,7 +810,7 @@ sub process_head { print HTML "
    \n" unless $listlevel || $top; print HTML ""; # unless $listlevel; #print HTML "" unless $listlevel; - my $convert = $heading; process_text(\$convert); + my $convert = $heading; process_text(\$convert, 0); print HTML '$convert"; print HTML ""; # unless $listlevel; print HTML "\n"; @@ -998,7 +1005,12 @@ sub process_text { $rest = $$text; if ($rest =~ /^\s+/) { # preformatted text, no pod directives - $rest =~ s/\n+\Z//; + $rest =~ s/\n+\Z//; + $rest =~ s#.*# + my $line = $&; + 1 while $line =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; + $line; + #eg; $rest =~ s/&/&/g; $rest =~ s/