texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/Plaintext.pm (_convert) <emp


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Plaintext.pm (_convert) <empty_line>: Try to separate form feed handling from code that actually adds an empty line to the output. Call _add_newline_if_needed to output the newline and increment the count of empty lines.
Date: Sat, 20 Jan 2024 20:03:45 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 50e2dfa6c3 * tp/Texinfo/Convert/Plaintext.pm (_convert) <empty_line>: 
Try to separate form feed handling from code that actually adds an empty line 
to the output.  Call _add_newline_if_needed to output the newline and increment 
the count of empty lines.
50e2dfa6c3 is described below

commit 50e2dfa6c3e900525ef6a7daf34e2bc6ca59e23c
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Jan 21 00:56:02 2024 +0000

    * tp/Texinfo/Convert/Plaintext.pm (_convert) <empty_line>:
    Try to separate form feed handling from code that actually adds
    an empty line to the output.  Call _add_newline_if_needed to
    output the newline and increment the count of empty lines.
---
 ChangeLog                                           |  7 +++++++
 tp/Texinfo/Convert/Plaintext.pm                     | 11 ++++++-----
 tp/t/results/coverage_braces/empty_line_in_email.pl |  3 ++-
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ad5cfb4000..5839cba070 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-01-21  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Plaintext.pm (_convert) <empty_line>:
+       Try to separate form feed handling from code that actually adds
+       an empty line to the output.  Call _add_newline_if_needed to
+       output the newline and increment the count of empty lines.
+
 2024-01-20  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/DocBook.pm (_convert): do not ignore especially
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 3d1c18b2c1..1f41b32f2e 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -1953,19 +1953,20 @@ sub _convert($$)
   # especially
   if ($type and ($type eq 'empty_line'
                  or $type eq 'after_menu_description_line')) {
-    #if (!$self->{'text_element_context'}) {
-    #  cluck;
-    #}
     delete $self->{'text_element_context'}->[-1]->{'counter'};
-    $self->{'empty_lines_count'}++;
-    if ($self->{'empty_lines_count'} <= 1
+    if ($self->{'empty_lines_count'} == 0
         or 
$self->{'preformatted_context_commands'}->{$self->{'context'}->[-1]}) {
       if ($element->{'text'} =~ /\f/) {
         my $result = _get_form_feeds($element->{'text'});
         _stream_output($self, undef, $result);
       }
+    }
+    if ($self->{'preformatted_context_commands'}->{$self->{'context'}->[-1]}) {
       _stream_output($self, $formatter->{'container'},
                 add_text($formatter->{'container'}, "\n"));
+      $self->{'empty_lines_count'}++;
+    } else {
+      $self->_add_newline_if_needed();
     }
     return;
   }
diff --git a/tp/t/results/coverage_braces/empty_line_in_email.pl 
b/tp/t/results/coverage_braces/empty_line_in_email.pl
index d6465397cf..3146fa7ffd 100644
--- a/tp/t/results/coverage_braces/empty_line_in_email.pl
+++ b/tp/t/results/coverage_braces/empty_line_in_email.pl
@@ -104,7 +104,8 @@ $result_floats{'empty_line_in_email'} = {};
 
 
 
-$result_converted{'plaintext'}->{'empty_line_in_email'} = '< >
+$result_converted{'plaintext'}->{'empty_line_in_email'} = '
+<>
    mail,
 
    text



reply via email to

[Prev in Thread] Current Thread [Next in Thread]