Permalink
Browse files

import Pod::Simple 0.98 from CPAN

git-cpan-module: Pod::Simple
git-cpan-version: 0.98
git-cpan-authorid: SBURKE
  • Loading branch information...
1 parent 79695b4 commit a6876ea5d04099dc475398ffdb7ab1dd1c789831 Sean M. Burke committed with schwern Sep 2, 2003
Showing with 79 additions and 10 deletions.
  1. +9 −2 ChangeLog
  2. +8 −6 MANIFEST
  3. +12 −0 META.yml
  4. +12 −1 lib/Pod/Simple.pm
  5. +1 −1 lib/Pod/Simple/BlackBox.pm
  6. +37 −0 t/itemadapt.t
View
@@ -1,5 +1,12 @@
-# ChangeLog for Pod::Simple dist # Time-stamp: "2003-08-12 22:40:31 ADT"
-
+# ChangeLog for Pod::Simple dist # Time-stamp: "2003-09-01 20:52:05 ADT"
+
+2003-09-01 Sean M. Burke <sburke@cpan.org>
+ * Release 0.98
+ * At Michael Schwern's suggestion, a list that begins with a
+ "=item [number]" line where number isn't a 1, is no longer
+ treated as an error, but instead is silently coerced into being a
+ text-item list, just as if it were "=item wubble" or whatever.
+
2003-08-12 Sean M. Burke <sburke@cpan.org>
* Release 0.97
* Loooking goooooood. Not smelling so much like beta anymore!
View
@@ -1,8 +1,6 @@
ChangeLog
-MANIFEST
-MANIFEST.SKIP
-Makefile.PL
-README
+lib/perlpod.pod
+lib/perlpodspec.pod
lib/Pod/Simple.pm
lib/Pod/Simple.pod
lib/Pod/Simple/BlackBox.pm
@@ -25,8 +23,10 @@ lib/Pod/Simple/Text.pm
lib/Pod/Simple/TextContent.pm
lib/Pod/Simple/TiedOutFH.pm
lib/Pod/Simple/XMLOutStream.pm
-lib/perlpod.pod
-lib/perlpodspec.pod
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+README
t/ac_c_extend.t
t/ac_c_simple.t
t/ac_d.t
@@ -45,6 +45,7 @@ t/heads.t
t/html-para.t
t/html-styles.t
t/html-title.t
+t/itemadapt.t
t/items.t
t/itemstar.t
t/linkclass.t
@@ -66,3 +67,4 @@ t/test_old_perlvar_out.txt
t/verbatim_formatted.t
t/verbatims.t
t/x_nixer.t
+META.yml Module meta-data (added by MakeMaker)
View
@@ -0,0 +1,12 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Pod-Simple
+version: 0.98
+version_from: ./lib/Pod/Simple.pm
+installdirs: site
+requires:
+ Pod::Escapes: 1.03
+ Text::Wrap: 98.112902
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.16
View
@@ -16,7 +16,7 @@ use vars qw(
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '0.97';
+$VERSION = '0.98';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@@ -470,6 +470,17 @@ sub _complain_errata {
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+sub _get_initial_item_type {
+ # A hack-wrapper here for when you have like "=over\n\n=item 456\n\n"
+ my($self, $para) = @_;
+ return $para->[1]{'~type'} if $para->[1]{'~type'};
+
+ return $para->[1]{'~type'} = 'text'
+ if join("\n", @{$para}[2 .. $#$para]) =~ m/^\s*(\d+)\.?\s*$/s and $1 ne '1';
+ # Else fall thru to the general case:
+ return $self->_get_item_type($para);
+}
+
sub _get_item_type { # mutates the item!!
my($self, $para) = @_;
@@ -620,7 +620,7 @@ sub _ponder_paragraph_buffer {
my $list_type;
if($paras->[0][0] eq '=item') { # most common case
- $list_type = $self->_get_item_type($paras->[0]);
+ $list_type = $self->_get_initial_item_type($paras->[0]);
} elsif($paras->[0][0] eq '=back') {
# Ignore empty lists. TODO: make this an option?
View
@@ -0,0 +1,37 @@
+
+use strict;
+use Test;
+BEGIN { plan tests => 4 };
+
+my $d;
+#use Pod::Simple::Debug (\$d,0);
+
+ok 1;
+
+use Pod::Simple::DumpAsXML;
+use Pod::Simple::XMLOutStream;
+print "# Pod::Simple version $Pod::Simple::VERSION\n";
+sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
+
+my $x = 'Pod::Simple::XMLOutStream';
+
+print "##### Tests for =item directives via class $x\n";
+
+$Pod::Simple::XMLOutStream::ATTR_PAD = ' ';
+$Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output
+
+
+print "#\n# Tests for =item [number] that are icky...\n";
+ok( $x->_out("\n=over\n\n=item 5\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4\n\nQuux\n\n=back\n\n"),
+ '<Document><over-text indent="4"><item-text>5</item-text><Para>Stuff</Para><item-text>4</item-text><Para>Quux</Para></over-text></Document>'
+);
+
+ok( $x->_out("\n=over\n\n=item 5.\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4.\n\nQuux\n\n=back\n\n"),
+ '<Document><over-text indent="4"><item-text>5.</item-text><Para>Stuff</Para><item-text>4.</item-text><Para>Quux</Para></over-text></Document>'
+);
+
+
+print "# Wrapping up... one for the road...\n";
+ok 1;
+print "# --- Done with ", __FILE__, " --- \n";
+

0 comments on commit a6876ea

Please sign in to comment.