texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Wed, 2 Aug 2023 06:57:32 -0400 (EDT)

branch: master
commit 2b30bee205ba014022bb56428f618c867a39c9c8
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Aug 2 11:57:16 2023 +0100

    * tp/Texinfo/Convert/Plaintext.pm (_convert) <node description>:
    Use the same code for @nodedescription and @nodedescriptionblock
    for adding extra spaces if needed to separate the description.
    Use the previous converter for adding the spaces and add two
    spaces rather than one.  Suggestion from Patrice.
---
 ChangeLog                                             |  8 ++++++++
 tp/Texinfo/Convert/Plaintext.pm                       | 19 ++++++++-----------
 tp/t/results/menu/nodedescription_descriptions.pl     |  6 +++---
 .../results/menu/nodedescriptionblock_descriptions.pl |  4 ++--
 4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 40cd14f86a..4bb259a901 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-08-02  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Plaintext.pm (_convert) <node description>:
+       Use the same code for @nodedescription and @nodedescriptionblock
+       for adding extra spaces if needed to separate the description.
+       Use the previous converter for adding the spaces and add two
+       spaces rather than one.  Suggestion from Patrice.
+
 2023-08-01  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi: Start removing @menu throughout.
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index dedffb2408..f7824efdb9 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3526,24 +3526,21 @@ sub _convert($$)
               $self->{'silent'}++;
             }
 
+            if ($text_count >= $description_indent_length) {
+              $result .= _count_added($self, $formatter->{'container'},
+                               add_text($formatter->{'container'}, '  '));
+              $result .= _count_added($self,
+                             $formatter->{'container'},
+                             add_pending_word($formatter->{'container'}, 1));
+            }
+
             if ($description_element->{'cmdname'} eq 'nodedescription') {
               # push a paragraph container to format the description.
               $description_para = $self->new_formatter('paragraph',
                   { 'indent_length' => $description_indent_length });
-              if ($result !~ /\s$/) {
-                $result .= _count_added($self, 
$description_para->{'container'},
-                                 add_text($description_para->{'container'}, ' 
'));
-              }
               push @{$self->{'formatters'}}, $description_para;
               $formatted_elt = $description_element->{'args'}->[0];
             } else {
-              if ($text_count >= $description_indent_length) {
-                $result .= _count_added($self, $formatter->{'container'},
-                                 add_text($formatter->{'container'}, ' '));
-                $result .= _count_added($self,
-                               $formatter->{'container'},
-                               add_pending_word($formatter->{'container'}, 1));
-              }
               push @{$self->{'format_context'}},
                { 'cmdname' => $description_element->{'cmdname'},
                  'paragraph_count' => 0,
diff --git a/tp/t/results/menu/nodedescription_descriptions.pl 
b/tp/t/results/menu/nodedescription_descriptions.pl
index 8c0ab593b5..6250567923 100644
--- a/tp/t/results/menu/nodedescription_descriptions.pl
+++ b/tp/t/results/menu/nodedescription_descriptions.pl
@@ -1927,12 +1927,12 @@ 
$result_converted{'plaintext'}->{'nodedescription_descriptions'} = 'test of node
 * name of other: other.        other comes here
 
 * name of last: last. desc of last
-* a somewhat long node without description nor following space:: not as long as
+* a somewhat long node without description nor following space::  not as long 
as
                                the node
-* a very long node without description with very little space left for::
+* a very long node without description with very little space left for::  
                                starting the desciption with a somewhat long
                                word
-* very very long node extending past the max columns and without description::
+* very very long node extending past the max columns and without description:: 
 
                                Not long
 
 1 Toto
diff --git a/tp/t/results/menu/nodedescriptionblock_descriptions.pl 
b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
index 5b300ffd74..f3b2cb7911 100644
--- a/tp/t/results/menu/nodedescriptionblock_descriptions.pl
+++ b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
@@ -1915,9 +1915,9 @@ 
$result_converted{'plaintext'}->{'nodedescriptionblock_descriptions'} = 'test of
 
                                    a quotation in description
 
-* a somewhat long node without description nor following space:: not as long as
+* a somewhat long node without description nor following space::  not as long 
as
                                the node
-* node double nodedescriptionblock:: block desc 1
+* node double nodedescriptionblock::  block desc 1
 
 1 Toto
 ******



reply via email to

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