diff options
Diffstat (limited to 'MDK/Common/String.pm')
-rw-r--r-- | MDK/Common/String.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/MDK/Common/String.pm b/MDK/Common/String.pm index bf8ac90..2325623 100644 --- a/MDK/Common/String.pm +++ b/MDK/Common/String.pm @@ -132,15 +132,14 @@ sub formatAlaTeX { sub warp_text { - my ($text, $width) = @_; - $width ||= 80; + my ($text, $o_width) = @_; my @l; foreach (split "\n", $text) { my ($beg) = /^(\s*)/; my $t = ''; foreach (split /\s+/, $_) { - if (length "$beg$t $_" > $width) { + if (length "$beg$t $_" > ($o_width || 80)) { push @l, "$beg$t"; $beg = ''; $t = $_; |