texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Transformations.pm (fill_gaps_in_sec


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Transformations.pm (fill_gaps_in_sectioning): tree element added for new section more in line with current tree elements.
Date: Tue, 06 Dec 2022 15:35:35 -0500

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

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f5530be375 * tp/Texinfo/Transformations.pm (fill_gaps_in_sectioning): 
tree element added for new section more in line with current tree elements.
f5530be375 is described below

commit f5530be3751a8ca0462fcd7c9c1d587eb8cbc5cd
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 6 21:35:15 2022 +0100

    * tp/Texinfo/Transformations.pm (fill_gaps_in_sectioning): tree
    element added for new section more in line with current tree elements.
---
 ChangeLog                     |  5 +++++
 tp/Texinfo/Transformations.pm | 28 +++++++++++-----------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c715b5031b..0d88a043ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-12-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Transformations.pm (fill_gaps_in_sectioning): tree
+       element added for new section more in line with current tree elements.
+
 2022-12-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_end_line_starting_block): allow only
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index db64b3740c..dc9016d277 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -116,28 +116,22 @@ sub fill_gaps_in_sectioning($)
         while ($next_section_level - $current_section_level > 1) {
           $current_section_level++;
           my $new_section = {'cmdname' =>
-            
$Texinfo::Common::level_to_structuring_command{'unnumbered'}->[$current_section_level],
+            $Texinfo::Common::level_to_structuring_command{'unnumbered'}
+                                                  ->[$current_section_level],
             'parent' => $root,
+            'info' => {'spaces_before_argument' => ' '},
           };
+          my $line_arg = {'type' => 'line_arg', 'parent' => $new_section,
+                          'info' => {'spaces_after_argument' => "\n"}};
+          $new_section->{'args'} = [$line_arg];
+          my $asis_command = {'cmdname' => 'asis',
+                              'parent' => $line_arg};
+          $line_arg->{'contents'} = [$asis_command];
+          $asis_command->{'args'} = [{'type' => 'brace_command_arg',
+                                      'parent' => $asis_command}];
           $new_section->{'contents'} = [{'type' => 'empty_line',
                                          'text' => "\n",
                                          'parent' => $new_section}];
-          $new_section->{'args'} = [{'type' => 'line_arg',
-                                     'parent' => $new_section}];
-          $new_section->{'args'}->[0]->{'contents'} = [
-             {'cmdname' => 'asis',
-              'parent' => $new_section->{'args'}->[0]
-             },
-             {'type' => 'spaces_at_end',
-              'text' => "\n",
-              'parent' => $new_section->{'args'}->[0]
-             }];
-          $new_section->{'args'}->[0]->{'info'}
-            = {'spaces_before_argument' => ' '};
-          $new_section->{'args'}->[0]->{'contents'}->[0]->{'args'}
-             = [{'type' => 'brace_command_arg',
-                 'contents' => [],
-                 'parent' => $new_section->{'args'}->[0]->{'contents'}->[1]}];
           push @contents, $new_section;
           push @added_sections, $new_section;
         }



reply via email to

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