diff options
-rw-r--r-- | MANIFEST | 2 | ||||
-rw-r--r-- | lib/Pod/Html.pm | 2 | ||||
-rw-r--r-- | lib/Pod/t/htmllink.pod | 107 | ||||
-rw-r--r-- | lib/Pod/t/htmllink.t | 129 |
4 files changed, 239 insertions, 1 deletions
@@ -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 0f7f380a7b..b4949b6ae8 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 0000000000..2113db7462 --- /dev/null +++ b/lib/Pod/t/htmllink.pod @@ -0,0 +1,107 @@ +=head1 NAME + +htmllink - Test HTML links + +=head1 LINKS + +L</"section1"> + +L</"section 2"> + +L</"section three"> + +L</"item1"> + +L</"item 2"> + +L</"item three"> + +L</section1> + +L</section 2> + +L</section three> + +L</item1> + +L</item 2> + +L</item three> + +L<"section1"> + +L<"section 2"> + +L<"section three"> + +L<"item1"> + +L<"item 2"> + +L<"item three"> + +L<text|/"section1"> + +L<text|/"section 2"> + +L<text|/"section three"> + +L<text|/"item1"> + +L<text|/"item 2"> + +L<text|/"item three"> + +L<text|/section1> + +L<text|/section 2> + +L<text|/section three> + +L<text|/item1> + +L<text|/item 2> + +L<text|/item three> + +L<text|"section1"> + +L<text|"section 2"> + +L<text|"section three"> + +L<text|"item1"> + +L<text|"item 2"> + +L<text|"item three"> + +=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 0000000000..27142e698b --- /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__ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>htmllink - Test HTML links</title> +<link rev="made" href="mailto:" /> +</head> + +<body style="background-color: white"> + +<p><a name="__index__"></a></p> +<!-- INDEX BEGIN --> + +<ul> + + <li><a href="#name">NAME</a></li> + <li><a href="#links">LINKS</a></li> + <li><a href="#targets">TARGETS</a></li> + <ul> + + <li><a href="#section1">section1</a></li> + <li><a href="#section_2">section 2</a></li> + <li><a href="#section_three">section three</a></li> + </ul> + +</ul> +<!-- INDEX END --> + +<hr /> +<p> +</p> +<h1><a name="name">NAME</a></h1> +<p>htmllink - Test HTML links</p> +<p> +</p> +<hr /> +<h1><a name="links">LINKS</a></h1> +<p><a href="#section1">section1</a></p> +<p><a href="#section_2">section 2</a></p> +<p><a href="#section_three">section three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> +<p><a href="#section1">section1</a></p> +<p><a href="#section_2">section 2</a></p> +<p><a href="#section_three">section three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> +<p><a href="#section1">section1</a></p> +<p><a href="#section_2">section 2</a></p> +<p><a href="#section_three">section three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> +<p><a href="#section1">text</a></p> +<p><a href="#section_2">text</a></p> +<p><a href="#section_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> +<p><a href="#section1">text</a></p> +<p><a href="#section_2">text</a></p> +<p><a href="#section_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> +<p><a href="#section1">text</a></p> +<p><a href="#section_2">text</a></p> +<p><a href="#section_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> +<p> +</p> +<hr /> +<h1><a name="targets">TARGETS</a></h1> +<p> +</p> +<h2><a name="section1">section1</a></h2> +<p>This is section one.</p> +<p> +</p> +<h2><a name="section_2">section 2</a></h2> +<p>This is section two.</p> +<p> +</p> +<h2><a name="section_three">section three</a></h2> +<p>This is section three.</p> +<dl> +<dt><strong><a name="item_item1">item1</a></strong><br /> +</dt> +<dd> +This is item one. +</dd> +<p></p> +<dt><strong><a name="item_item_2">item 2</a></strong><br /> +</dt> +<dd> +This is item two. +</dd> +<p></p> +<dt><strong><a name="item_item_three">item three</a></strong><br /> +</dt> +<dd> +This is item three. +</dd> +<p></p></dl> + +</body> + +</html> |