[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 8 Nov 2022 17:12:06 -0500 (EST) |
branch: master
commit c901614992d613085a6522250f7ccbed777fab31
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 3de27a677b..8028a4fc5b 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 6fec314a8f..113ad55bfc 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 83a55e3dc9..68a5194ebf 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 9747f64a6f..8dad9f7b95 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>) {