# ChangeLog for Pod::Simple dist
#---------------------------------------------------------------------------
+2012-03-01 David E. Wheeler <david@justatheory.org>
+ * Release 3.20
+
+ Removed use of 'done_testing' in t/xhtml15.t, which was added in
+ v3.19. Thanks to Paul Howarth for the catch.
+
+ Fixed quoting of links in a regular expression Pod::Simple::Text.
+ Reported by Father Chrysostomos.
+
+ Fix test failure on case-insensitive, non-case-preserving file systems
+ (VMS I'm looking at *you*). Patch from Craig A. Berry.
+
+ Pod::Simple::HTML no longer emits "href='#___top'" if a TOC
+ (index) is not output. Patch from Rick Myers.
+
+ Fixed links in the TOC of XHTML output to use IDs derived from encoded
+ text, rather than raw Pod, so that it will link to the ID actually
+ generated for the section. Thanks to Randy Stauner for the report
+ (with test case!) (RT #72544).
+
+ PullParser now throws an exception on an attempt to set a source
+ more than once. Necessary because data from the previous source
+ will be cached, so the new source would be ignored anyway. Create a
+ new PullParser, instead. Thanks to Paul Boldra for the report (RT
+ #74265).
+
2011-08-23 David E. Wheeler <david@justatheory.org>
* Release 3.19
-=head1 Pod::Simple version 3.19
+=head1 Pod::Simple version 3.20
Pod::Simple is a Perl library for parsing text in the Pod ("plain old
documentation") markup language that is typically used for writing
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.19';
+$VERSION = '3.20';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
use strict;
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
$para->[1]{'title'} = $title if ($title);
$para->[1]{'target'} = $target; # without any ':'
$content = $target; # strip off the title
-
+
$content =~ s/^:!/!:/s;
my $neg; # whether this is a negation-match
$neg = 1 if $content =~ s/^!//s;
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
package Pod::Simple::Debug;
use strict;
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
sub import {
my($value,$variable);
require 5;
package Pod::Simple::DumpAsText;
-$VERSION = '3.19';
+$VERSION = '3.20';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.19';
+$VERSION = '3.20';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.19';
+$VERSION = '3.20';
BEGIN {
if(defined &DEBUG) { } # no-op
$name = $self->do_section($name, $token) if defined $name;
print $fh "<a ";
- print $fh "class='u' href='#___top' title='click to go to top of document'\n"
- if $tagname =~ m/^head\d$/s;
+ if ($tagname =~ m/^head\d$/s) {
+ print $fh "class='u'", $self->index
+ ? " href='#___top' title='click to go to top of document'\n"
+ : "\n";
+ }
if(defined $name) {
my $esc = esc( $self->section_name_tidy( $name ) );
use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION
$CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA
);
-$VERSION = '3.19';
+$VERSION = '3.20';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
use strict;
use Pod::Simple::BlackBox;
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
use overload( # So it'll stringify nice
'""' => \&Pod::Simple::BlackBox::stringify_lol,
use strict;
use Pod::Simple ();
use vars qw(@ISA $VERSION);
-$VERSION = '3.19';
+$VERSION = '3.20';
@ISA = ('Pod::Simple');
# Yes, we could use named variables, but I want this to be impose
require 5;
package Pod::Simple::Progress;
-$VERSION = '3.19';
+$VERSION = '3.20';
use strict;
# Objects of this class are used for noting progress of an
require 5;
package Pod::Simple::PullParser;
-$VERSION = '3.19';
+$VERSION = '3.20';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
sub set_source {
my $self = shift @_;
return $self->{'source_fh'} unless @_;
+ Carp::croak("Cannot assign new source to pull parser; create a new instance, instead")
+ if $self->{'source_fh'} || $self->{'source_scalar_ref'} || $self->{'source_arrayref'};
my $handle;
if(!defined $_[0]) {
Carp::croak("Can't use empty-string as a source for set_source");
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.19';
+$VERSION = '3.20';
sub new { # Class->new(tagname);
my $class = shift;
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.19';
+$VERSION = '3.20';
sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.19';
+$VERSION = '3.20';
sub new { # Class->new(text);
my $class = shift;
package Pod::Simple::PullParserToken;
# Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
@ISA = ();
-$VERSION = '3.19';
+$VERSION = '3.20';
use strict;
sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
-$VERSION = '3.19';
+$VERSION = '3.20';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.19'; ## Current version of this package
+$VERSION = '3.20'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.19';
+$VERSION = '3.20';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
my($parser, $element_name, $attr_hash_r) = @_;
# NOTE: $attr_hash_r is only present when $element_name is "over" or "begin"
# The remaining code excerpts will mostly ignore this $attr_hash_r, as it is
- # mostly useless. It is documented where "over-*" and "begin" events are
+ # mostly useless. It is documented where "over-*" and "begin" events are
# documented.
...
}
</over-block>
Note that the outer C<=over> is a block because it has no C<=item>s but still
-has content: the inner C<=over>. The inner C<=over>, in turn, is completely
+has content: the inner C<=over>. The inner C<=over>, in turn, is completely
empty, and is treated as such.
=item events with an element_name of item-bullet
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION $FREAKYMODE);
-$VERSION = '3.19';
+$VERSION = '3.20';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
if (my $link = delete $_[0]{'Link'}) {
# Append the URL to the output unless it's already present.
$_[0]{'Thispara'} .= " <$link->{to}>"
- unless $_[0]{'Thispara'} =~ /\b\E$link->{to}/;
+ unless $_[0]{'Thispara'} =~ /\b\Q$link->{to}/;
}
}
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
@ISA = ('Pod::Simple');
sub new {
use Symbol ('gensym');
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
require 5;
package Pod::Simple::Transcode;
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
BEGIN {
if(defined &DEBUG) {;} # Okay
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
-$VERSION = '3.19';
+$VERSION = '3.20';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
use Pod::Simple;
require Encode;
use vars qw($VERSION );
-$VERSION = '3.19';
+$VERSION = '3.20';
sub is_dumb {0}
sub is_smart {1}
package Pod::Simple::XHTML;
use strict;
use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
-$VERSION = '3.19';
+$VERSION = '3.20';
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
my ($self, $to, $section) = @_;
return undef unless defined $to || defined $section;
if (defined $section) {
- $section = '#' . $self->idify($section, 1);
+ $section = '#' . $self->idify($self->encode_entities($section), 1);
return $section unless defined $to;
} else {
$section = ''
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.19';
+$VERSION = '3.20';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
$_[0]->code_handler(sub { $more .= $_[1] . ":" . $_[0] . "\n" } );
$_[0]->cut_handler( sub { $more .= "~" . $_[1] . ":" . $_[0]. "\n" } );
$_[0]->pod_handler( sub { $more .= "+" . $_[1] . ":" . $_[0]. "\n" } );
- $_[0]->whiteline_handler(
+ $_[0]->whiteline_handler(
sub { $more .= "=" . $_[1] . ":" . $_[0]. "\n" } );
} => join "\n",
" ", # space outside pod
print "# Wrapping up... one for the road...\n";
ok 1;
print "# --- Done with ", __FILE__, " --- \n";
+
qq{=pod\n\nI like S<L</"bric-a-brac a gogo">>.\n},
qq{=pod\n\nI like L<"bric-a-bracE<160>aE<160>gogo"|/"bric-a-brac a gogo">.\n},
));
-&ok(
+&ok(
map {my $z = $_; $z =~ s/raw=".+?" //g; $z }
$x->_duo( sub { $_[0]->nbsp_for_S(1) },
qq{=pod\n\nI like S<L<Stuff like that|"bric-a-brac a gogo">>.\n},
use strict;
use Test;
-BEGIN { plan tests => 114 };
+BEGIN { plan tests => 116 };
#use Pod::Simple::Debug (5);
ok( $t && $t->type, 'text');
ok( $t && $t->type eq 'text' && $t->text, 'NAME' );
+DIE: {
+ # Make sure we die.
+ local $@;
+ eval { $p->set_source(\'=head1 foo') };
+ ok $@;
+ ok $@ =~ /\QCannot assign new source to pull parser; create a new instance, instead/;
+}
}
###########################################################################
print $p;
{
-my $names = join "|", sort values %$where2name;
-ok lc($names), lc("Suzzle");
+my $names = lc join "|", sort values %$where2name;
+ok $names, "suzzle";
}
{
-my $names = join "|", sort keys %$name2where;
-ok lc($names), lc("Suzzle");
+my $names = lc join "|", sort keys %$name2where;
+ok $names, "suzzle";
}
ok( ($name2where->{'Vliff'} || 'huh???'), 'huh???');
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;
</ol>
EOF
+
+$ENV{FOO}= 1;
+
+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<...> Codes</a></li>
+</ul>
+
+<h1 id="Foo">Foo</h1>
+
+<p>Test links from perlpodspec: <a href="#$id">"About L<...> Codes"</a></p>
+
+<h1 id="$id">About L<...> Codes</h1>
+
+<p>Here it is</p>
+
+EOF
+
sub initialize {
$_[0] = Pod::Simple::XHTML->new;
$_[0]->html_header('');
use strict;
use warnings;
-use lib 'lib';
-use Test::More;
+use Test::More tests => 4;
use_ok('Pod::Simple::XHTML') or exit;
#note('These methods are called when XHTML is used by HtmlBatch');
can_ok $parser, qw/batch_mode_page_object_init html_header_after_title/;
-done_testing;
-
sub initialize {
$parser = Pod::Simple::XHTML->new;
$parser->index(1);