summaryrefslogtreecommitdiff
path: root/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm')
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm14
1 files changed, 4 insertions, 10 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
index e43422bbd7..f467f430c2 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
@@ -1,13 +1,14 @@
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.20';
+$VERSION = '3.22';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
use strict;
use Carp ();
+use Text::Wrap qw(wrap);
BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG }
@@ -49,15 +50,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;