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