Upgrade to podlators-2.1.4
[p5sagit/p5-mst-13.2.git] / lib / Pod / Text.pm
index d52bb53..98dd434 100644 (file)
@@ -1,7 +1,7 @@
 # Pod::Text -- Convert POD data to formatted ASCII text.
 #
-# Copyright 1999, 2000, 2001, 2002, 2004, 2006
-#     by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008
+#     Russ Allbery <rra@stanford.edu>
 #
 # This program is free software; you may redistribute it and/or modify it
 # under the same terms as Perl itself.
@@ -37,10 +37,7 @@ use Pod::Simple ();
 # We have to export pod2text for backward compatibility.
 @EXPORT = qw(pod2text);
 
-# Don't use the CVS revision as the version, since this module is also in Perl
-# core and too many things could munge CVS magic revision strings.  This
-# number should ideally be the same as the CVS revision in podlators, however.
-$VERSION = 3.08;
+$VERSION = 3.11;
 
 ##############################################################################
 # Initialization
@@ -88,6 +85,13 @@ sub new {
     my @opts = map { ("opt_$_", $opts{$_}) } keys %opts;
     %$self = (%$self, @opts);
 
+    # Send errors to stderr if requested.
+    if ($$self{opt_stderr}) {
+        $self->no_errata_section (1);
+        $self->complain_stderr (1);
+        delete $$self{opt_stderr};
+    }
+
     # Initialize various things from our parameters.
     $$self{opt_alt}      = 0  unless defined $$self{opt_alt};
     $$self{opt_indent}   = 4  unless defined $$self{opt_indent};
@@ -241,7 +245,8 @@ sub reformat {
     return $self->wrap ($_);
 }
 
-# Output text to the output device.
+# Output text to the output device.  Replace non-breaking spaces with spaces
+# and soft hyphens with nothing.
 sub output {
     my ($self, $text) = @_;
     $text =~ tr/\240\255/ /d;
@@ -634,6 +639,9 @@ __END__
 
 Pod::Text - Convert POD data to formatted ASCII text
 
+=for stopwords
+alt stderr Allbery Sean Burke's Christiansen
+
 =head1 SYNOPSIS
 
     use Pod::Text;
@@ -712,6 +720,11 @@ spaces, and will try to preserve that spacing.  If set to false, all
 consecutive whitespace in non-verbatim paragraphs is compressed into a
 single space.  Defaults to true.
 
+=item stderr
+
+Send error messages about invalid POD to standard error instead of
+appending a POD ERRORS section to the generated output.
+
 =item width
 
 The column at which to wrap text on the right-hand side.  Defaults to 76.
@@ -777,7 +790,8 @@ how to use Pod::Simple.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 1999, 2000, 2001, 2002, 2004, 2006 Russ Allbery <rra@stanford.edu>.
+Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008 Russ Allbery
+<rra@stanford.edu>.
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.