diff options
Diffstat (limited to 'cpan/Pod-Simple/lib')
28 files changed, 203 insertions, 45 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm index 51f9a69801..bd03190168 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple.pm @@ -18,7 +18,7 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.14'; +$VERSION = '3.15'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm index 9917898cff..8ea9ee92ee 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm @@ -23,7 +23,7 @@ use integer; # vroom! use strict; use Carp (); use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; #use constant DEBUG => 7; BEGIN { require Pod::Simple; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm index 26a6023723..3bfd67f17a 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm @@ -9,7 +9,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm index 1349be32cb..a620204dbe 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::Debug; use strict; use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; sub import { my($value,$variable); diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm index 91554341e3..327b9a894c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '3.14'; +$VERSION = '3.15'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm index d83f8d33f5..84f5c8bb4d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '3.14'; +$VERSION = '3.15'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm index b1a75cb4e3..21bf7c24fd 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm @@ -10,7 +10,7 @@ use vars qw( $Doctype_decl $Content_decl ); @ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.14'; +$VERSION = '3.15'; BEGIN { if(defined &DEBUG) { } # no-op @@ -81,7 +81,7 @@ __PACKAGE__->_accessorize( # out of apparently longstanding habit) 'html_css', # URL of CSS file to point to - 'html_javascript', # URL of CSS file to point to + 'html_javascript', # URL of Javascript file to point to 'force_title', # should already be &-escaped 'default_title', # should already be &-escaped @@ -685,6 +685,8 @@ sub section_escape { sub section_name_tidy { my($self, $section) = @_; + $section =~ s/^\s+//; + $section =~ s/\s+$//; $section =~ tr/ /_/; $section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy characters $section = $self->unicode_escape_url($section); @@ -897,25 +899,176 @@ TODO =head1 CALLING FROM PERL -TODO make a new object, set any options, and use parse_from_file +=head2 Minimal code + use Pod::Simple::HTML; + my $html; + $p->output_string(\$html); + $p->parse_from_file('path/to/Module/Name.pm'); + open my $out, '>', 'out.html' or die; + print $out $html; + +=head2 More detailed example + + use Pod::Simple::HTML; + +Set the content type: + + $Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >}; + + my $p = Pod::Simple::HTML->new; + +Include a single javascript source: + + $p->html_javascript('http://abc.com/a.js'); + +Or insert multiple javascript source in the header +(or for that matter include anything, thought this is not recommended) + + $p->html_javascript(' + <script type="text/javascript" src="http://abc.com/b.js"></script> + <script type="text/javascript" src="http://abc.com/c.js"></script>'); + +Include a single css source in the header: + + $p->html_css('/style.css'); + +or insert multiple css sources: + + $p->html_css(' + <link rel="stylesheet" type="text/css" title="pod_stylesheet" href="http://remote.server.com/jquery.css"> + <link rel="stylesheet" type="text/css" title="pod_stylesheet" href="/style.css">'); + +Tell the parser where should the output go. In this case it will be placed in the $html variable: + + my $html; + $p->output_string(\$html); + +Parse and process a file with pod in it: + + $p->parse_from_file('path/to/Module/Name.pm'); =head1 METHODS TODO all (most?) accessorized methods +The following variables need to be set B<before> the call to the ->new constructor. + +Set the string that is included before the opening <html> tag: + + $Pod::Simple::HTML::Doctype_decl = qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd">\n}; + +Set the content-type in the HTML head: (defaults to ISO-8859-1) + + $Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >}; + +Set the value that will be ebedded in the opening tags of F, C tags and verbatim text. +F maps to <em>, C maps to <code>, Verbatim text maps to <pre> (Computerese defaults to "") + + $Pod::Simple::HTML::Computerese = ' class="some_class_name'; + +=head2 html_css + +=head2 html_javascript + +=head2 title_prefix + +=head2 title_postfix + +=head2 html_header_before_title + +This includes everything before the <title> opening tag including the Document type +and including the opening <title> tag. The following call will set it to be a simple HTML +file: + + $p->html_header_before_title('<html><head><title>'); + +=head2 html_h_level + +Normally =head1 will become <h1>, =head2 will become <h2> etc. +Using the html_h_level method will change these levels setting the h level +of =head1 tags: + + $p->html_h_level(3); + +Will make sure that =head1 will become <h3> and =head2 will become <h4> etc... + + +=head2 index + +Set it to some true value if you want to have an index (in reality a table of contents) +to be added at the top of the generated HTML. + + $p->index(1); + +=head2 html_header_after_title + +Includes the closing tag of </title> and throught the rest of the head +till the opening of the body + + $p->html_header_after_title('</title>...</head><body id="my_id">'); + +=head2 html_footer + +The very end of the document: + + $p->html_footer( qq[\n<!-- end doc -->\n\n</body></html>\n] ); =head1 SUBCLASSING -TODO +Can use any of the methods described above but for further customization +one needs to override some of the methods: + + package My::Pod; + use strict; + use warnings; + + use base 'Pod::Simple::HTML'; + + # needs to return a URL string such + # http://some.other.com/page.html + # #anchor_in_the_same_file + # /internal/ref.html + sub do_pod_link { + # My::Pod object and Pod::Simple::PullParserStartToken object + my ($self, $link) = @_; + + say $link->tagname; # will be L for links + say $link->attr('to'); # + say $link->attr('type'); # will be 'pod' always + say $link->attr('section'); + + # Links local to our web site + if ($link->tagname eq 'L' and $link->attr('type') eq 'pod') { + my $to = $link->attr('to'); + if ($to =~ /^Padre::/) { + $to =~ s{::}{/}g; + return "/docs/Padre/$to.html"; + } + } - can just set any of: html_css html_javascript title_prefix - 'html_header_before_title', - 'html_header_after_title', - 'html_footer', + # all other links are generated by the parent class + my $ret = $self->SUPER::do_pod_link($link); + return $ret; + } -maybe override do_pod_link + 1; + +Meanwhile in script.pl: + + use My::Pod; + + my $p = My::Pod->new; + + my $html; + $p->output_string(\$html); + $p->parse_from_file('path/to/Module/Name.pm'); + open my $out, '>', 'out.html' or die; + print $out $html; + +TODO maybe override do_beginning do_end diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm index 227c23b7f9..52b8a802f0 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm @@ -5,7 +5,7 @@ use strict; use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA ); -$VERSION = '3.14'; +$VERSION = '3.15'; @ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! # TODO: nocontents stylesheets. Strike some of the color variations? @@ -726,7 +726,7 @@ sub _gen_css_wad { 'whtgrng', # white_with_green_on_grey 'grygrnw', # grey_with_green_on_white ) { - my $outname = "$variation\_"; + my $outname = $variation; my $this_css = join "\n", "/* This file is autogenerated. Do not edit. $outname */\n", "\@import url(\"./_$variation.css\");", @@ -735,7 +735,7 @@ sub _gen_css_wad { ; my $name = $outname; $name =~ tr/-_/ /; - $self->add_css( "$outname.css", 0, $name, 0, 0, \$this_css); + $self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css); } return; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm index e426b2c547..185b2b67e8 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm @@ -3,12 +3,12 @@ require 5; package Pod::Simple::LinkSection; # Based somewhat dimly on Array::Autojoin use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; use strict; use Pod::Simple::BlackBox; use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; use overload( # So it'll stringify nice '""' => \&Pod::Simple::BlackBox::stringify_lol, diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm index bed3e8662b..2c28602175 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm @@ -4,7 +4,7 @@ package Pod::Simple::Methody; use strict; use Pod::Simple (); use vars qw(@ISA $VERSION); -$VERSION = '3.14'; +$VERSION = '3.15'; @ISA = ('Pod::Simple'); # Yes, we could use named variables, but I want this to be impose diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm index 7de46d5696..03bff6772c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::Progress; -$VERSION = '3.14'; +$VERSION = '3.15'; use strict; # Objects of this class are used for noting progress of an diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm index c27d0cbeb0..9c8378e554 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '3.14'; +$VERSION = '3.15'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm index 67a625d887..21ae23fe9c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.14'; +$VERSION = '3.15'; sub new { # Class->new(tagname); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm index 37d68ef619..d346e39243 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.14'; +$VERSION = '3.15'; sub new { # Class->new(tagname, optional_attrhash); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm index ed6340d598..ad72a89a46 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.14'; +$VERSION = '3.15'; sub new { # Class->new(text); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm index 2234ccf7ad..861a1d26bc 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::PullParserToken; # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token @ISA = (); -$VERSION = '3.14'; +$VERSION = '3.15'; use strict; sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway diff --git a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm index f476d37b24..71ba107d60 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm @@ -8,7 +8,7 @@ package Pod::Simple::RTF; use strict; use vars qw($VERSION @ISA %Escape $WRAP %Tagmap); -$VERSION = '3.14'; +$VERSION = '3.15'; use Pod::Simple::PullParser (); BEGIN {@ISA = ('Pod::Simple::PullParser')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm index 762701aa9c..bb9371a24d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm @@ -4,7 +4,7 @@ package Pod::Simple::Search; use strict; use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = '3.14'; ## Current version of this package +$VERSION = '3.15'; ## Current version of this package BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level use Carp (); diff --git a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm index 32db4b6a51..92cf7b95b0 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.14'; +$VERSION = '3.15'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod index f2011d5a5c..426fa8911e 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod +++ b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod @@ -887,6 +887,8 @@ L<Pod::Simple::Text> -- a simple plaintext formatter for Pod L<Pod::Simple::TextContent> -- like Pod::Simple::Text, but makes no effort for indent or wrap the text being formatted +L<Pod::Simple::HTML> -- a simple HTML formatter for Pod + L<perlpod|perlpod> L<perlpodspec|perlpodspec> diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm index 81fde4e7a7..6f05f89832 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm @@ -6,7 +6,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '3.14'; +$VERSION = '3.15'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm index 914c7fd166..5220698456 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; @ISA = ('Pod::Simple'); sub new { diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm index c5d4483b28..13c7ec7d46 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm @@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH; use Symbol ('gensym'); use Carp (); use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm index 258d0d7676..9ee47964f5 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm @@ -2,7 +2,7 @@ require 5; package Pod::Simple::Transcode; use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm index d1c320d5d1..95b5fc86e2 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm @@ -5,7 +5,7 @@ require 5; package Pod::Simple::TranscodeDumb; use strict; use vars qw($VERSION %Supported); -$VERSION = '3.14'; +$VERSION = '3.15'; # This module basically pretends it knows how to transcode, except # only for null-transcodings! We use this when Encode isn't # available. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm index bab59fc897..8979bd27bf 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm @@ -9,7 +9,7 @@ use strict; use Pod::Simple; require Encode; use vars qw($VERSION ); -$VERSION = '3.14'; +$VERSION = '3.15'; sub is_dumb {0} sub is_smart {1} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm index 6a8fb7e97e..e160b30db8 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm @@ -28,7 +28,7 @@ L<Pod::Simple::HTML>, but it largely preserves the same interface. package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.14'; +$VERSION = '3.15'; use Carp (); use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); @@ -165,7 +165,7 @@ __PACKAGE__->_accessorize( 'man_url_prefix', 'man_url_postfix', 'title_prefix', 'title_postfix', - 'html_css', + 'html_css', 'html_javascript', 'html_doctype', 'html_header_tags', @@ -372,7 +372,7 @@ sub end_item_text { } # This handles =begin and =for blocks of all kinds. -sub start_for { +sub start_for { my ($self, $flags) = @_; push @{ $self->{__region_targets} }, $flags->{target_matching}; @@ -386,7 +386,7 @@ sub start_for { $self->emit; } -sub end_for { +sub end_for { my ($self) = @_; $self->{'scratch'} .= '</div>' unless $self->__in_literal_xhtml_region; @@ -395,7 +395,7 @@ sub end_for { $self->emit; } -sub start_Document { +sub start_Document { my ($self) = @_; if (defined $self->html_header) { $self->{'scratch'} .= $self->html_header; @@ -407,7 +407,7 @@ sub start_Document { $metatags = $self->html_header_tags || ''; if ($self->html_css) { $metatags .= "\n<link rel='stylesheet' href='" . - $self->html_css . "' type='text/css'>"; + $self->html_css . "' type='text/css' />"; } if ($self->html_javascript) { $metatags .= "\n<script type='text/javascript' src='" . @@ -500,10 +500,12 @@ sub end_I { $_[0]{'scratch'} .= '</i>' } sub start_L { my ($self, $flags) = @_; my ($type, $to, $section) = @{$flags}{'type', 'to', 'section'}; - my $url = $type eq 'url' ? $to + my $url = encode_entities( + $type eq 'url' ? $to : $type eq 'pod' ? $self->resolve_pod_page_link($to, $section) : $type eq 'man' ? $self->resolve_man_page_link($to, $section) - : undef; + : undef + ); # If it's an unknown type, use an attribute-less <a> like HTML.pm. $self->{'scratch'} .= '<a' . ($url ? ' href="'. $url . '">' : '>'); @@ -627,6 +629,7 @@ sub idify { for ($t) { s/<[^>]+>//g; # Strip HTML. s/&[^;]+;//g; # Strip entities. + s/^\s+//; s/\s+$//; # Strip white space. s/^([^a-zA-Z]+)$/pod$1/; # Prepend "pod" if no valid chars. s/^[^a-zA-Z]+//; # First char must be a letter. s/[^-a-zA-Z0-9_:.]+/-/g; # All other chars must be valid. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm index 2e6b42834e..0cd1a70e73 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.14'; +$VERSION = '3.15'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; |