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) <nod


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Plaintext.pm (_convert) <node description>: If adding extra space before node description, count this space in the line length.
Date: Wed, 02 Aug 2023 16:54:29 -0400

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 1bc5824f2c * tp/Texinfo/Convert/Plaintext.pm (_convert) <node 
description>: If adding extra space before node description, count this space 
in the line length.
1bc5824f2c is described below

commit 1bc5824f2c4aa1d633d62210f1bc7daa210f620c
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Aug 2 21:54:18 2023 +0100

    * tp/Texinfo/Convert/Plaintext.pm (_convert) <node description>:
    If adding extra space before node description, count this space
    in the line length.
---
 ChangeLog                                            |  6 ++++++
 tp/Texinfo/Convert/Plaintext.pm                      | 20 ++++++++++++--------
 tp/t/results/menu/nodedescription_descriptions.pl    |  4 ++--
 .../menu/nodedescriptionblock_descriptions.pl        |  4 ++--
 4 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b95ecd243b..f2b46922e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-08-02  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Plaintext.pm (_convert) <node description>:
+       If adding extra space before node description, count this space
+       in the line length.
+
 2023-08-02  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi (Hardcopy with TeX): Edit and condense.  Reference
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index f7824efdb9..eed028ba2a 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3504,6 +3504,18 @@ sub _convert($$)
             my $formatted_elt;
             my $description_para;
             my $text_count = 
Texinfo::Convert::Paragraph::counter($formatter->{'container'});
+
+            if ($text_count >= $description_indent_length) {
+              my $inserted_space = '  ';
+              $result .= _count_added($self, $formatter->{'container'},
+                               add_text($formatter->{'container'},
+                                        $inserted_space));
+              $result .= _count_added($self,
+                             $formatter->{'container'},
+                             add_pending_word($formatter->{'container'}, 1));
+              $text_count += length($inserted_space);
+            }
+
             my $text_element_context = {
                      'max' => $self->{'text_element_context'}->[-1]->{'max'},
                      'counter' => $text_count
@@ -3526,14 +3538,6 @@ 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',
diff --git a/tp/t/results/menu/nodedescription_descriptions.pl 
b/tp/t/results/menu/nodedescription_descriptions.pl
index 6250567923..7b2c316e81 100644
--- a/tp/t/results/menu/nodedescription_descriptions.pl
+++ b/tp/t/results/menu/nodedescription_descriptions.pl
@@ -1927,8 +1927,8 @@ 
$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
-                               the node
+* 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::  
                                starting the desciption with a somewhat long
                                word
diff --git a/tp/t/results/menu/nodedescriptionblock_descriptions.pl 
b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
index f3b2cb7911..58aa142d0c 100644
--- a/tp/t/results/menu/nodedescriptionblock_descriptions.pl
+++ b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
@@ -1915,8 +1915,8 @@ 
$result_converted{'plaintext'}->{'nodedescriptionblock_descriptions'} = 'test of
 
                                    a quotation in description
 
-* a somewhat long node without description nor following space::  not as long 
as
-                               the node
+* a somewhat long node without description nor following space::  not as long
+                               as the node
 * node double nodedescriptionblock::  block desc 1
 
 1 Toto



reply via email to

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