Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Pod-Simple CPAN distribution.

Report information
The Basics
Id: 72544
Status: resolved
Priority: 0/
Queue: Pod-Simple

People
Owner: Nobody in particular
Requestors: RWSTAUNER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.19
Fixed in: 3.20



Subject: Link id mismatch between h1 and anchor for complex cases
I noticed this issue on metacpan: https://github.com/CPAN-API/cpan-api/issues/147 Pod section links with certain characters aren't always the same between the id of the h1 and the href that points to it. Here is an example from perlpodspec: Pod: L</"About LE<lt>...E<gt> Codes"> =head1 About LE<lt>...E<gt> Codes Html: <a href="#About-L-Codes"> <h1 id="About-L...-Codes">About L&lt;...&gt; Codes</h1> Attached is a patch to the tests that demonstrates the failure (it's much easier to see if you use Test::Differences::eq_or_diff). It appears that the index at the top matches the h1 (not the a). So the link from the index works, but the one mid-document does not. I don't have the tuits to track down the source of the issue... Hopefully it will be easier for someone more familiar with the project.
sorry, trigger finger
Subject: pod-simple-link-mismatch-test.patch
diff --git a/t/xhtml10.t b/t/xhtml10.t index 6f54dd4..f90872c 100644 --- a/t/xhtml10.t +++ b/t/xhtml10.t @@ -8,7 +8,7 @@ BEGIN { use strict; use lib '../lib'; -use Test::More tests => 56; +use Test::More tests => 58; #use Test::More 'no_plan'; use_ok('Pod::Simple::XHTML') or exit; @@ -653,6 +653,36 @@ is $results, <<'EOF', 'Do not anchor =item directives'; </ol> EOF + +initialize($parser, $results); +ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD'; +=head1 Foo + +Test links from perlpodspec: L</"About LE<lt>...E<gt> Codes"> + +=head1 About LE<lt>...E<gt> Codes + +Here it is +EOPOD + +my $id = 'About-L...-Codes'; # what should this be? + +is $results, <<EOF, 'anchor and h1 use same section id for complex sections'; +<ul id="index"> + <li><a href="#Foo">Foo</a></li> + <li><a href="#$id">About L&lt;...&gt; Codes</a></li> +</ul> + +<h1 id="Foo">Foo</h1> + +<p>Test links from perlpodspec: <a href="#$id">&quot;About L&lt;...&gt; Codes&quot;</a></p> + +<h1 id="$id">About L&lt;...&gt; Codes</h1> + +<p>Here it is</p> + +EOF + sub initialize { $_[0] = Pod::Simple::XHTML->new; $_[0]->html_header('');
Fixed here: https://github.com/theory/pod- simple/commit/a2a82d646e894ba85b0ffc26fccf420296ae4387 Thanks for the awesome test case!