[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 22 Dec 2023 12:13:04 -0500 (EST) |
branch: master
commit 16fe6813333c4dbf079c0583c1f062cdbbe857e8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Dec 22 18:12:59 2023 +0100
* tp/Texinfo/Convert/HTML.pm (_convert_explained_command): remove
element_explanation_content now that it is not required as there is
no possibility of infinite recursive expansions any more.
---
ChangeLog | 6 ++++++
tp/Texinfo/Convert/HTML.pm | 29 ++++-------------------------
tp/Texinfo/XS/main/converter_types.h | 2 --
3 files changed, 10 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 00c4cbbaaf..e991832811 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-12-22 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_explained_command): remove
+ element_explanation_content now that it is not required as there is
+ no possibility of infinite recursive expansions any more.
+
2023-12-22 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (_convert_explained_command): convert
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 62c06ddd86..764c22a4fe 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -3320,40 +3320,20 @@ sub _convert_explained_command($$$$)
my $explained_commands
= $self->shared_conversion_state('explained_commands', {});
$explained_commands->{$cmdname} = {} if (!$explained_commands->{$cmdname});
- my $element_explanation_content
- = $self->shared_conversion_state('element_explanation_content', {});
+
if ($args and $args->[1] and defined($args->[1]->{'string'})
and $args->[1]->{'string'} =~ /\S/) {
$with_explanation = 1;
$explanation_string = $args->[1]->{'string'};
- # Convert the explanation of the acronym. Must do this before we save
- # the explanation for the future, otherwise we get infinite recursion
- # for recursively-defined acronyms.
+ # Convert the explanation of the acronym. Doing this before of after
+ # saving the explanation for the future changes the output for
+ # recursively-defined acronyms.
$explanation_result = $self->convert_tree($args->[1]->{'tree'},
"convert $cmdname explanation");
$explained_commands->{$cmdname}->{$normalized_type} = $explanation_string;
- } elsif (exists($element_explanation_content->{$command})) {
- # if an acronym element is formatted more than once, this ensures that
- # only the first explanation (including a lack of explanation) is reused.
- # Note that this means that acronyms converted first on a sectioning
- # command line for a direction text may not get the explanation
- # from acronyms appearing later on in the document but before
- # the sectioning command.
- $explanation_string = $element_explanation_content->{$command};
} elsif ($explained_commands->{$cmdname}->{$normalized_type}) {
$explanation_string = $explained_commands->{$cmdname}->{$normalized_type};
- $element_explanation_content->{$command} = $explanation_string;
- } else {
- # Avoid ever giving an explanation for this element, even if an
- # explanation could appear later on, for instance if acronym is
- # formatted early on a sectioning command line and the acronym is
- # defined before the sectioning command in the document. This prevents
- # infinite recursion for a recursively-defined acronym, when an
- # @acronym within the explanation could end up referring to the
- # containing @acronym.
-
- $element_explanation_content->{$command} = undef;
}
my $result = '';
if ($args and defined($args->[0])) {
@@ -8157,7 +8137,6 @@ sub _load_htmlxref_files {
# shared_conversion_state
# Set through the shared_conversion_state API (among others):
# explained_commands # used only in an @-command conversion function
-# element_explanation_contents # same as above
#
# API exists
# current_filename
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index 5d6d8cef76..7d00f89177 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -285,8 +285,6 @@ typedef struct HTML_TARGET_LIST {
typedef struct HTML_SHARED_CONVERSION_STATE {
int explained_commands; /* explained_commands->{char $cmdname}->{char
$normalized_type}
= ELEMENT */
- int element_explanation_content; /* element_explanation_content->{ELEMENT
$command}
- = ELEMENT */
int footnote_id_numbers; /* footnote_id_numbers->{char $footid} = int */
/* Not useful, directly use expanded formats in the converter.
Needed in perl as expanded formats are accessed per format in the API