From: Yitzchak Scott-Thoennes Date: Mon, 4 Jul 2005 02:07:38 +0000 (-0700) Subject: Pod::Html - correctly link to =item's on the same page X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e38a594fb2312d48815b72c0456fcd281ea8917;p=p5sagit%2Fp5-mst-13.2.git Pod::Html - correctly link to =item's on the same page Message-ID: <20050704090738.GA4056@efn.org> (plus a new test, although it is currently marked TODO) p4raw-id: //depot/perl@25083 --- diff --git a/MANIFEST b/MANIFEST index 8041796..204ffe9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1864,6 +1864,8 @@ lib/Pod/Text/Termcap.pm Convert POD data to ASCII text with format escapes lib/Pod/t/Functions.t See if Pod::Functions works lib/Pod/t/htmlescp.pod pod2html escape test input data lib/Pod/t/htmlescp.t pod2html escape test +lib/Pod/t/htmllink.pod pod2html link test input data +lib/Pod/t/htmllink.t pod2html link test lib/Pod/t/htmlview.pod pod2html render test input data lib/Pod/t/htmlview.t pod2html render test lib/Pod/t/InputObjects.t See if Pod::InputObjects works diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 0f7f380..b4949b6 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -1883,7 +1883,7 @@ sub coderef($$){ my( $url ); my $fid = fragment_id( $item ); - if( defined( $page ) ){ + if( defined( $page ) && $page ne "" ){ # we have been given a $page... $page =~ s{::}{/}g; diff --git a/lib/Pod/t/htmllink.pod b/lib/Pod/t/htmllink.pod new file mode 100644 index 0000000..2113db7 --- /dev/null +++ b/lib/Pod/t/htmllink.pod @@ -0,0 +1,107 @@ +=head1 NAME + +htmllink - Test HTML links + +=head1 LINKS + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L<"section1"> + +L<"section 2"> + +L<"section three"> + +L<"item1"> + +L<"item 2"> + +L<"item three"> + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +L + +=head1 TARGETS + +=head2 section1 + +This is section one. + +=head2 section 2 + +This is section two. + +=head2 section three + +This is section three. + +=over 4 + +=item item1 + +This is item one. + +=item item 2 + +This is item two. + +=item item three + +This is item three. + +=back diff --git a/lib/Pod/t/htmllink.t b/lib/Pod/t/htmllink.t new file mode 100644 index 0000000..27142e6 --- /dev/null +++ b/lib/Pod/t/htmllink.t @@ -0,0 +1,129 @@ +#!/usr/bin/perl -w # -*- perl -*- + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; + unshift @INC, '../lib/Pod/t'; + require "pod2html-lib.pl"; +} + +use strict; +use Test::More tests => 1; + +TODO: { + local $TODO = "item 2 doesn't work as expected"; + convert_n_test("htmllink", "html links"); +} + +__DATA__ + + + +htmllink - Test HTML links + + + + + +

+ + + + + +
+

+

+

NAME

+

htmllink - Test HTML links

+

+

+
+

LINKS

+

section1

+

section 2

+

section three

+

item1

+

item 2

+

item three

+

section1

+

section 2

+

section three

+

item1

+

item 2

+

item three

+

section1

+

section 2

+

section three

+

item1

+

item 2

+

item three

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

text

+

+

+
+

TARGETS

+

+

+

section1

+

This is section one.

+

+

+

section 2

+

This is section two.

+

+

+

section three

+

This is section three.

+
+
item1
+
+
+This is item one. +
+

+
item 2
+
+
+This is item two. +
+

+
item three
+
+
+This is item three. +
+

+ + + +