diff options
Diffstat (limited to 'Locale/Po4a')
-rw-r--r-- | Locale/Po4a/Text.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Locale/Po4a/Text.pm b/Locale/Po4a/Text.pm index 093b572..fad995a 100644 --- a/Locale/Po4a/Text.pm +++ b/Locale/Po4a/Text.pm @@ -140,6 +140,7 @@ sub parse { $paragraph=""; } + # TODO: preserve original line ends throughout the code instead chomp($line); $self->{ref}="$ref"; if ($debianchangelog and @@ -162,6 +163,8 @@ sub parse { $line =~ m/^%%?\s*$/) { # Found end of fortune do_paragraph($self,$paragraph,$wrapped_mode); + # FIXME: test if this is still needed when always adding + # newline in do_paragraph() $self->pushline("\n") unless ( $wrapped_mode == 0 or $paragraph eq ""); $paragraph=""; @@ -170,8 +173,6 @@ sub parse { } elsif ($line =~ /^\s*$/) { # Break paragraphs on lines containing only spaces do_paragraph($self,$paragraph,$wrapped_mode); - $self->pushline("\n") unless ( $wrapped_mode == 0 - or $paragraph eq ""); $paragraph=""; $wrapped_mode = 1; $self->pushline($line."\n"); @@ -277,10 +278,16 @@ TEST_BULLET: } # TODO: detect indented paragraphs - $self->pushline( $self->translate($paragraph, + my $transfinal = $self->translate($paragraph, $self->{ref}, "Plain text", - "wrap" => $wrap) ); + "wrap" => $wrap); + + # TODO: preserve original line ends throughout the code instead + chomp $transfinal; + $transfinal .= "\n"; + + $self->pushline( $transfinal ); } 1; |