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 (format_content


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Plaintext.pm (format_contents): Use convert_line_new_context instead of convert_line.
Date: Thu, 30 Nov 2023 12:52:14 -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 83d5dc5df6 * tp/Texinfo/Convert/Plaintext.pm (format_contents): Use 
convert_line_new_context instead of convert_line.
83d5dc5df6 is described below

commit 83d5dc5df637ff7963e0682195ebe1d550faadd6
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Nov 30 17:52:04 2023 +0000

    * tp/Texinfo/Convert/Plaintext.pm (format_contents):
    Use convert_line_new_context instead of convert_line.
---
 ChangeLog                       | 5 +++++
 tp/Texinfo/Convert/Plaintext.pm | 6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ce626e851..d53cc4e2f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-11-30  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Plaintext.pm (format_contents):
+       Use convert_line_new_context instead of convert_line.
+
 2023-11-29  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/Convert/Plaintext.pm (convert_line_new_context):
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index eb6c48cc79..99fc67b362 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -793,7 +793,7 @@ sub convert_line($$;$)
 }
 
 # convert with a line formatter in a new count context, not changing
-# the current context.
+# the current context.  return the result of the conversion.
 sub convert_line_new_context($$;$)
 {
   my ($self, $converted, $conf) = @_;
@@ -1217,7 +1217,6 @@ sub format_contents($$$)
     my $section = $top_section;
  SECTION:
     while ($section) {
-      push @{$self->{'count_context'}}, {'lines' => 0, 'bytes' => 0};
       my $section_title_tree;
       if (defined($section->{'extra'}->{'section_number'})
           and ($self->get_conf('NUMBER_SECTIONS')
@@ -1237,10 +1236,9 @@ sub format_contents($$$)
       } else {
         $section_title_tree = $section->{'args'}->[0];
       }
-      my $section_title = $self->convert_line(
+      my $section_title = $self->convert_line_new_context(
             {'contents' => [$section_title_tree],
              'type' => 'frenchspacing'});
-      pop @{$self->{'count_context'}};
       my $text = $section_title;
       chomp ($text);
       $text .= "\n";



reply via email to

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