diff options
author | Jari Aalto <jari.aalto@poboxes.com> | 2007-03-04 05:33:20 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-14 15:50:21 +0000 |
commit | 25ff0154ccf606eb5512a8cde622caf50e20fba3 (patch) | |
tree | 0913a6dd78ecb614d1f302e5c4ff20749bd002d1 /lib/Pod | |
parent | 8e3df7c8b2759d638ad5d2c93ee07c622dd1b193 (diff) | |
download | perl-25ff0154ccf606eb5512a8cde622caf50e20fba3.tar.gz |
[perl #41698] [PATCH] v5.8.8 pod2html -- Add <div>..</div> around the outputted INDEX section
From: Jari Aalto (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-2051-1173043999-1740.41698-75-0@perl.org>
plus test adjustments
p4raw-id: //depot/perl@30583
Diffstat (limited to 'lib/Pod')
-rw-r--r-- | lib/Pod/Html.pm | 26 | ||||
-rw-r--r-- | lib/Pod/t/htmlescp.t | 8 | ||||
-rw-r--r-- | lib/Pod/t/htmllink.t | 8 | ||||
-rw-r--r-- | lib/Pod/t/htmlview.t | 8 |
4 files changed, 37 insertions, 13 deletions
diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index f524eff318..03ac8f0d5e 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -498,13 +498,25 @@ END_OF_HEAD # still generate an index, but surround it with an html comment. # that way some other program can extract it if desired. $index =~ s/--+/-/g; - print HTML "<p><a name=\"__index__\"></a></p>\n"; - print HTML "<!-- INDEX BEGIN -->\n"; - print HTML "<!--\n" unless $Doindex; - print HTML $index; - print HTML "-->\n" unless $Doindex; - print HTML "<!-- INDEX END -->\n\n"; - print HTML "<hr />\n" if $Doindex and $index; + + my $hr = ($Doindex and $index) ? qq(<hr name="index" />) : ""; + + unless ($Doindex) + { + $index = qq(<!--\n$index\n-->\n); + } + + print HTML << "END_OF_INDEX"; + +<!-- INDEX BEGIN --> +<div name="index"> +<p><a name=\"__index__\"></a></p> +$index +$hr +</div> +<!-- INDEX END --> + +END_OF_INDEX # now convert this file my $after_item; # set to true after an =item diff --git a/lib/Pod/t/htmlescp.t b/lib/Pod/t/htmlescp.t index c31d5c21c8..16503c4d95 100644 --- a/lib/Pod/t/htmlescp.t +++ b/lib/Pod/t/htmlescp.t @@ -24,17 +24,21 @@ __DATA__ <body style="background-color: white"> -<p><a name="__index__"></a></p> + <!-- INDEX BEGIN --> +<div name="index"> +<p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#description">DESCRIPTION</a></li> </ul> + +<hr name="index" /> +</div> <!-- INDEX END --> -<hr /> <p> </p> <h1><a name="name">NAME</a></h1> diff --git a/lib/Pod/t/htmllink.t b/lib/Pod/t/htmllink.t index f68edf3fb8..7d03e07345 100644 --- a/lib/Pod/t/htmllink.t +++ b/lib/Pod/t/htmllink.t @@ -24,8 +24,10 @@ __DATA__ <body style="background-color: white"> -<p><a name="__index__"></a></p> + <!-- INDEX BEGIN --> +<div name="index"> +<p><a name="__index__"></a></p> <ul> @@ -40,9 +42,11 @@ __DATA__ </ul> </ul> + +<hr name="index" /> +</div> <!-- INDEX END --> -<hr /> <p> </p> <h1><a name="name">NAME</a></h1> diff --git a/lib/Pod/t/htmlview.t b/lib/Pod/t/htmlview.t index 32956419e4..9b9bb90ffe 100644 --- a/lib/Pod/t/htmlview.t +++ b/lib/Pod/t/htmlview.t @@ -24,8 +24,10 @@ __DATA__ <body style="background-color: white"> -<p><a name="__index__"></a></p> + <!-- INDEX BEGIN --> +<div name="index"> +<p><a name="__index__"></a></p> <ul> @@ -43,9 +45,11 @@ __DATA__ <li><a href="#testing_urls_hyperlinking">TESTING URLs hyperlinking</a></li> <li><a href="#see_also">SEE ALSO</a></li> </ul> + +<hr name="index" /> +</div> <!-- INDEX END --> -<hr /> <p> </p> <h1><a name="name">NAME</a></h1> |