summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm17
1 files changed, 6 insertions, 11 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
index e43422bbd7c..ac925c08eff 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
@@ -1,13 +1,14 @@
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.20';
+$VERSION = '3.28';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
use strict;
use Carp ();
+use Text::Wrap qw(wrap);
BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG }
@@ -16,6 +17,7 @@ sub new {
my $new = $self->SUPER::new(@_);
$new->{'output_fh'} ||= *STDOUT{IO};
$new->accept_codes('VerbatimFormatted');
+ $new->keep_encoding_directive(1);
return $new;
}
@@ -49,15 +51,8 @@ sub _handle_text {
my $indent = ' ' x $_[0]{'indent'};
my $text = $_[1];
_xml_escape($text);
- $text =~ # A not-totally-brilliant wrapping algorithm:
- s/(
- [^\n]{55} # Snare some characters from a line
- [^\n\ ]{0,50} # and finish any current word
- )
- \x20{1,10}(?!\n) # capture some spaces not at line-end
- /$1\n$indent/gx # => line-break here
- ;
-
+ local $Text::Wrap::huge = 'overflow';
+ $text = wrap('', $indent, $text);
print {$_[0]{'output_fh'}} $indent, $text, "\n";
}
return;
@@ -133,7 +128,7 @@ pod-people@perl.org mail list. Send an empty email to
pod-people-subscribe@perl.org to subscribe.
This module is managed in an open GitHub repository,
-L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
to clone L<git://github.com/theory/pod-simple.git> and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to