summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod/PlainText.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/PlainText.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/PlainText.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/PlainText.pm b/Master/tlpkg/tlperl/lib/Pod/PlainText.pm
index 0dce1799b2b..06df184097f 100644
--- a/Master/tlpkg/tlperl/lib/Pod/PlainText.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/PlainText.pm
@@ -29,7 +29,7 @@ use vars qw(@ISA %ESCAPES $VERSION);
# by Pod::Usage.
@ISA = qw(Pod::Select);
-$VERSION = '2.04';
+$VERSION = '2.05';
BEGIN {
if ($] < 5.006) {
@@ -390,7 +390,7 @@ sub cmd_for {
my $self = shift;
local $_ = shift;
my $line = shift;
- return unless s/^text\b[ \t]*\n?//;
+ return unless s/^text\b[ \t]*\r?\n?//;
$self->verbatim ($_, $line);
}
@@ -485,7 +485,7 @@ sub item {
my $margin = $$self{MARGIN};
$$self{MARGIN} = $indent;
my $output = $self->reformat ($tag);
- $output =~ s/\n*$/\n/;
+ $output =~ s/[\r\n]*$/\n/;
$self->output ($output);
$$self{MARGIN} = $margin;
$self->output ($self->reformat ($_)) if /\S/;
@@ -514,7 +514,7 @@ sub wrap {
my $spaces = ' ' x $$self{MARGIN};
my $width = $$self{width} - $$self{MARGIN};
while (length > $width) {
- if (s/^([^\n]{0,$width})\s+// || s/^([^\n]{$width})//) {
+ if (s/^([^\r\n]{0,$width})\s+// || s/^([^\r\n]{$width})//) {
$output .= $spaces . $1 . "\n";
} else {
last;
@@ -535,8 +535,8 @@ sub reformat {
# munging to support that. Otherwise, smash all repeated whitespace.
if ($$self{sentence}) {
s/ +$//mg;
- s/\.\n/. \n/g;
- s/\n/ /g;
+ s/\.\r?\n/. \n/g;
+ s/[\r\n]+/ /g;
s/ +/ /g;
} else {
s/\s+/ /g;
@@ -723,6 +723,8 @@ subclass of it does. Look for L<Pod::Text::Termcap|Pod::Text::Termcap>.
=head1 SEE ALSO
+B<Pod::PlainText> is part of the L<Pod::Parser> distribution.
+
L<Pod::Parser|Pod::Parser>, L<Pod::Text::Termcap|Pod::Text::Termcap>,
pod2text(1)