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: Sat, 12 Nov 2022 17:25:46 -0500 (EST)

branch: release/7.0
commit 1c4530de8a374f85e2fbc108a676c0f34de0697a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 8 23:11:55 2022 +0100

    * tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/TexinfoMarkup.pm,
    tp/Texinfo/Convert/Utils.pm: convert only if contents are defined,
    initialize contents if needed.
---
 ChangeLog                           |  6 ++++++
 tp/Texinfo/Convert/IXIN.pm          | 14 +++++++++-----
 tp/Texinfo/Convert/TexinfoMarkup.pm |  7 +++++--
 tp/Texinfo/Convert/Utils.pm         |  1 +
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0c6dba4c0a..b49cdcff01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/TexinfoMarkup.pm,
+       tp/Texinfo/Convert/Utils.pm: convert only if contents are defined,
+       initialize contents if needed.
+
 2022-11-08  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/LaTeX.pm (_prepare_conversion, _title_font)
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index cfefd541a1..5325478d0c 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -783,13 +783,17 @@ sub output_ixin($$)
     foreach my $command (@{$self->{'global_commands'}->{'listoffloats'}}) {
       my $associated_node_id = $self->_associated_node_id($command,
                                                      \%node_label_number);
-      my $type = $command->{'extra'}->{'type'}->{'normalized'};
-      if ($command->{'extra'}->{'type'}->{'content'}) {
-        $floats_information{$type}->{'type'}
-          = $self->convert_tree({'contents'
+      if ($command->{'extra'}
+          and $command->{'extra'}->{'type'}
+          and defined($command->{'extra'}->{'type'}->{'normalized'})) {
+        my $type = $command->{'extra'}->{'type'}->{'normalized'};
+        if ($command->{'extra'}->{'type'}->{'content'}) {
+          $floats_information{$type}->{'type'}
+            = $self->convert_tree({'contents'
                              => $command->{'extra'}->{'type'}->{'content'}});
+        }
+        push @{$floats_information{$type}->{'node_id'}}, $associated_node_id;
       }
-      push @{$floats_information{$type}->{'node_id'}}, $associated_node_id;
     }
   }
 
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index c87d54cffa..87232550df 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -992,6 +992,7 @@ sub _convert($$;$)
         my $command_result = '';
         if (scalar (@{$element->{'args'}}) == 2
               and defined($element->{'args'}->[-1])
+              and $element->{'args'}->[-1]->{'contents'}
               and @{$element->{'args'}->[-1]->{'contents'}}) {
           $command_result = $self->_convert({'contents'
                         => $element->{'args'}->[-1]->{'contents'}});
@@ -1313,7 +1314,8 @@ sub _convert($$;$)
                 # Like 'prototypes' extra value, but keeping spaces information
                 if (defined $element->{'args'}->[0]
                     and defined $element->{'args'}->[0]->{'type'}
-                    and $element->{'args'}->[0]->{'type'} eq 'block_line_arg') 
{
+                    and $element->{'args'}->[0]->{'type'} eq 'block_line_arg'
+                    and $element->{'args'}->[0]->{'contents'}) {
                   foreach my $content 
(@{$element->{'args'}->[0]->{'contents'}}) {
                     if ($content->{'type'} and $content->{'type'} eq 
'bracketed') {
                       push @prototype_line, $content;
@@ -1374,7 +1376,8 @@ sub _convert($$;$)
                 $result .= $self->txi_markup_close_element('columnprototypes');
                 $result .= $self->format_comment_or_return_end_line($element);
               } elsif ($element->{'extra'}
-                         and $element->{'extra'}->{'columnfractions'}) {
+                       and $element->{'extra'}->{'columnfractions'}
+                       and $element->{'args'}->[0]->{'contents'}) {
                 my $cmd;
                 foreach my $content (@{$element->{'args'}->[0]->{'contents'}}) 
{
                   if ($content->{'cmdname'}
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index 97a5b5e9c2..b2dbdc0943 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -256,6 +256,7 @@ sub expand_verbatiminclude($$$)
       }
       $verbatiminclude = { 'cmdname' => 'verbatim',
                            'parent' => $current->{'parent'},
+                           'contents' => [],
                            'extra' =>
                         {'text_arg' => $current->{'extra'}->{'text_arg'}} };
       while (<VERBINCLUDE>) {



reply via email to

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