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: 74389
Status: resolved
Priority: 0/
Queue: Pod-Simple

People
Owner: Nobody in particular
Requestors: pertusus [...] free.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 3.24



Subject: Pod::Simple::Pullparser get_title should ignore X<...>
Date: Wed, 25 Jan 2012 21:09:42 +0100
To: bug-Pod-Simple [...] rt.cpan.org
From: Patrice Dumas <pertusus [...] free.fr>
With Pod::Simple 3.14. If a pod file has index entries after head: =head1 NAME X<Some entry> Pod::Simple::Pullparser get_title expands 'Some entry' in the title. It seems to me that it should not, and instead should replace it with an empty string. This behaviour is also hinted in the pod documentation. A look at the code in git makes me think that the same issue is still there (l. 363 and following all the text are used, X<> text is not discarded). This kind of construct is not rare, for instance it is present in the main perl pod documentation.
On 2012-01-25 15:09:59, pertusus@free.fr wrote: Show quoted text
> With Pod::Simple 3.14. > > If a pod file has index entries after head: > > =head1 NAME > X<Some entry> > > Pod::Simple::Pullparser get_title expands 'Some entry' in the title. It > seems to me that it should not, and instead should replace it with an > empty string. This behaviour is also hinted in the pod documentation. > > A look at the code in git makes me think that the same issue is still > there (l. 363 and following all the text are used, X<> text is not > discarded). > > This kind of construct is not rare, for instance it is present in the > main perl pod documentation.
Here’s a test case: diff --git a/t/pulltitl.t b/t/pulltitl.t index 22934f5..a846048 100644 --- a/t/pulltitl.t +++ b/t/pulltitl.t @@ -7,7 +7,7 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 116 }; +BEGIN { plan tests => 117 }; #use Pod::Simple::Debug (5); @@ -408,6 +408,13 @@ ok( $t && $t->type eq 'start' && $t->tagname, 'Document' ); } ######################################################################### ## +print "# Testing a title with an X<>, at line ", __LINE__, "\n"; +my $p = Pod::Simple::PullParser->new; +$p->set_source( \qq{\n=head1 NAME\nX<Some entry>\n} ); + +ok $p->get_title(), 'NAME'; + +######################################################################## ### ######################################################################### ## That fails with: not ok 116 # Test 116 got: "NAME Some entry" (t/pulltitl.t at line 415) # Expected: "NAME" # t/pulltitl.t line 415 is: ok $p->get_title(), 'NAME'; But there appear to be other issues with X<>, too. See the discussion here: http://code.activestate.com/lists/perl-pod-people/1698/ I'm waiting on more feedback before deciding what to do here. Thanks, David
Summary of issues to be addressed from the aforementioned pod-people thread: • Pod::Simple::HTML needs to be fixed so that it does not include the contents of X<> • The parser overall should be adjusted to remove superfluous whitespace
Fixed in https://github.com/theory/pod- simple/commit/a2047c42501c47f8fe8ff610f7f4cf65616ec54e.