[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch release/7.0 updated: * tp/Texinfo/Convert/HTML.pm (command_text,
From: |
Gavin D. Smith |
Subject: |
branch release/7.0 updated: * tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands) (_initialize_output_state): add 'referred_command_stack' to put commands that can be referred to being expanded, to catch if an @*ref refers to that command during the expansion, leading to an infinite recursion. In that case, use the node instead of the section, as with nodes only it is not possible to construct a an infinite recursion as the node must both be a reference target and refer to a specific target at the same [...] |
Date: |
Tue, 22 Nov 2022 15:10:28 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch release/7.0
in repository texinfo.
The following commit(s) were added to refs/heads/release/7.0 by this push:
new e6e886c4e9 * tp/Texinfo/Convert/HTML.pm (command_text,
_convert_xref_commands) (_initialize_output_state): add
'referred_command_stack' to put commands that can be referred to being
expanded, to catch if an @*ref refers to that command during the expansion,
leading to an infinite recursion. In that case, use the node instead of the
section, as with nodes only it is not possible to construct a an infinite
recursion as the node must both be a reference target and refer to a specif
[...]
e6e886c4e9 is described below
commit e6e886c4e9404f6de53ad339f6149abdba322aa6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 22 20:09:57 2022 +0000
* tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands)
(_initialize_output_state): add 'referred_command_stack' to put
commands that can be referred to being expanded, to catch if an @*ref
refers to that command during the expansion, leading to an infinite
recursion. In that case, use the node instead of the section, as with
nodes only it is not possible to construct a an infinite recursion
as the node must both be a reference target and refer to a specific
target at the same time, which is not possible. Report from David
Bacon.
---
ChangeLog | 12 +
tp/Makefile.tres | 3 +
tp/Texinfo/Convert/HTML.pm | 17 +-
tp/t/30sectioning.t | 20 +
...double_recursive_self_section_node_reference.pl | 471 +++++++++++++++++++++
.../double_recursive_self_section_reference.pl | 382 +++++++++++++++++
.../sectioning/recursive_self_section_reference.pl | 223 ++++++++++
7 files changed, 1127 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 67d17f6efb..130937f7cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2022-11-22 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands)
+ (_initialize_output_state): add 'referred_command_stack' to put
+ commands that can be referred to being expanded, to catch if an @*ref
+ refers to that command during the expansion, leading to an infinite
+ recursion. In that case, use the node instead of the section, as with
+ nodes only it is not possible to construct a an infinite recursion
+ as the node must both be a reference target and refer to a specific
+ target at the same time, which is not possible. Report from David
+ Bacon.
+
2022-11-20 Gavin Smith <gavinsmith0123@gmail.com>
* js/info.js (on_load): Update version number.
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 70194f1911..03472d4bc4 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1685,6 +1685,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/sectioning/contents_with_only_top_node.pl \
t/results/sectioning/double_node_anchor_float.pl \
t/results/sectioning/double_part.pl \
+ t/results/sectioning/double_recursive_self_section_node_reference.pl \
+ t/results/sectioning/double_recursive_self_section_reference.pl \
t/results/sectioning/double_top.pl \
t/results/sectioning/double_top_in_menu.pl \
t/results/sectioning/double_top_section.pl \
@@ -1771,6 +1773,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/sectioning/protected_node_parentheses.pl \
t/results/sectioning/raiselowersections.pl \
t/results/sectioning/rec_nodes.pl \
+ t/results/sectioning/recursive_self_section_reference.pl \
t/results/sectioning/ref_to_top.pl \
t/results/sectioning/ref_to_unknown_node.pl \
t/results/sectioning/reference_to_only_special_spaces_node.pl \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 0fd68beca8..23e0395b56 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1108,7 +1108,9 @@ sub command_text($$;$)
if (defined($target->{'tree_nonumber'}));
}
$self->{'ignore_notice'}++;
+ push @{$self->{'referred_command_stack'}}, $command;
$target->{$type} = $self->_convert($tree, $explanation);
+ pop @{$self->{'referred_command_stack'}};
$self->{'ignore_notice'}--;
$self->_pop_document_context();
@@ -4903,7 +4905,15 @@ sub _convert_xref_commands($$$$)
if (!defined($name)) {
if ($self->get_conf('xrefautomaticsectiontitle') eq 'on'
- and $node->{'extra'}->{'associated_section'}) {
+ and $node->{'extra'}->{'associated_section'}
+ # this condition avoids infinite recursions, indeed in that case
+ # the node will be used and not the section. There should not be
+ # @*ref in nodes, and even if there are, it does not seems to be
+ # possible to construct an infinite recursion with nodes only
+ # as the node must both be a reference target and refer to a specific
+ # target at the same time, which is not possible.
+ and not grep {$_ eq $node->{'extra'}->{'associated_section'}}
+ @{$self->{'referred_command_stack'}}) {
$command = $node->{'extra'}->{'associated_section'};
$name = $self->command_text($command, 'text_nonumber');
} elsif ($node->{'cmdname'} eq 'float') {
@@ -7001,6 +7011,7 @@ sub _load_htmlxref_files {
# htmlxref_files
# htmlxref
# check_htmlxref_already_warned
+# referred_command_stack
#
# from Converter
# labels
@@ -9529,6 +9540,10 @@ sub _initialize_output_state($)
$self->{'targets'} = {};
$self->{'seen_ids'} = {};
+ # to avoid infinite recursions when a section refers to itself, possibly
+ # indirectly
+ $self->{'referred_command_stack'} = [];
+
# for directions to special elements, only filled if special
# elements are actually used.
$self->{'special_elements_directions'} = {};
diff --git a/tp/t/30sectioning.t b/tp/t/30sectioning.t
index 4dd30bcee7..fcf89023be 100644
--- a/tp/t/30sectioning.t
+++ b/tp/t/30sectioning.t
@@ -536,6 +536,26 @@ in node Top
in chap
'],
+['recursive_self_section_reference',
+'@node sharp
+@chapter @ref{sharp} tuple
+'],
+['double_recursive_self_section_reference',
+'@node n1
+@chapter @ref{n2}
+
+@node n2
+@chapter @ref{n1}
+'],
+['double_recursive_self_section_node_reference',
+'@node Top
+@top top
+
+@node node1
+@chapter @ref{to node1}
+
+@node to @ref{node1}
+'],
);
my $character_and_spaces_in_refs_text = '@node Top
diff --git
a/tp/t/results/sectioning/double_recursive_self_section_node_reference.pl
b/tp/t/results/sectioning/double_recursive_self_section_node_reference.pl
new file mode 100644
index 0000000000..6caac8b471
--- /dev/null
+++ b/tp/t/results/sectioning/double_recursive_self_section_node_reference.pl
@@ -0,0 +1,471 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'double_recursive_self_section_node_reference'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'node1'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'node1'
+ }
+ ],
+ 'normalized' => 'node1',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'to node1'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'label' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'to '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'node1'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'label' => {},
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'node1'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {},
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {},
+ {}
+ ],
+ 'normalized' => 'to-node1'
+ }
+ ],
+ 'normalized' => 'to-node1',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'to-node1'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ },
+ {}
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[1]{'extra'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[3]{'extra'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[1]{'extra'}{'label'}
= $result_trees{'double_recursive_self_section_node_reference'}{'contents'}[3];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[1]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'node_content'}[1]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[1];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'nodes_manuals'}[0]{'node_content'}[1]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[1];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[5] =
$result_trees{'double_recursive_self_section_node_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'};
+
+$result_texis{'double_recursive_self_section_node_reference'} = '@node Top
+@top top
+
+@node node1
+@chapter @ref{to node1}
+
+@node to @ref{node1}
+';
+
+
+$result_texts{'double_recursive_self_section_node_reference'} = 'top
+***
+
+1 to node1
+**********
+
+';
+
+$result_sectioning{'double_recursive_self_section_node_reference'} = {
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'structure' => {}
+ }
+ },
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'node1'
+ },
+ 'structure' => {}
+ }
+ },
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 1,
+ 'section_up' => {},
+ 'toplevel_prev' => {},
+ 'toplevel_up' => {}
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'section_up' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
=
$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
=
$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'double_recursive_self_section_node_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
= $result_sectioning{'double_recursive_self_section_node_reference'};
+
+$result_nodes{'double_recursive_self_section_node_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'structure' => {}
+ },
+ 'normalized' => 'Top'
+ },
+ 'structure' => {
+ 'node_next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {},
+ 'structure' => {
+ 'section_number' => 1
+ }
+ },
+ 'normalized' => 'node1'
+ },
+ 'structure' => {
+ 'node_prev' => {},
+ 'node_up' => {}
+ }
+ }
+ }
+};
+$result_nodes{'double_recursive_self_section_node_reference'}{'structure'}{'node_next'}{'structure'}{'node_prev'}
= $result_nodes{'double_recursive_self_section_node_reference'};
+$result_nodes{'double_recursive_self_section_node_reference'}{'structure'}{'node_next'}{'structure'}{'node_up'}
= $result_nodes{'double_recursive_self_section_node_reference'};
+
+$result_menus{'double_recursive_self_section_node_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'structure' => {}
+};
+
+$result_errors{'double_recursive_self_section_node_reference'} = [
+ {
+ 'error_line' => 'warning: @ref should not appear in @node
+',
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => '',
+ 'text' => '@ref should not appear in @node',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: @ref to `to node1\', different from node name
`to @ref{node1}\'
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => '',
+ 'text' => '@ref to `to node1\', different from node name `to
@ref{node1}\'',
+ 'type' => 'warning'
+ }
+];
+
+
+$result_floats{'double_recursive_self_section_node_reference'} = {};
+
+
+
+$result_converted{'plaintext'}->{'double_recursive_self_section_node_reference'}
= 'top
+***
+
+1 *note to *note node1::::
+**************************
+
+';
+
+$result_converted_errors{'plaintext'}->{'double_recursive_self_section_node_reference'}
= [
+ {
+ 'error_line' => 'warning: @ref node name should not contain `:\'
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => '',
+ 'text' => '@ref node name should not contain `:\'',
+ 'type' => 'warning'
+ }
+];
+
+
+
+$result_converted{'html'}->{'double_recursive_self_section_node_reference'} =
'<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top</title>
+
+<meta name="description" content="top">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="#node1" accesskey="n" rel="next"><a class="ref"
href="#to-node1">to <a class="ref" href="#node1">node1</a></a></a> </p>
+</div>
+<h1 class="top" id="top">top</h1>
+
+<ul class="mini-toc">
+<li><a href="#node1" accesskey="1"><a class="ref" href="#to-node1">to <a
class="ref" href="#node1">node1</a></a></a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" id="node1">
+<div class="nav-panel">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top"
accesskey="u" rel="up">top</a> </p>
+</div>
+<h2 class="chapter" id="to-node1-1">1 <a class="ref" href="#to-node1">to <a
class="ref" href="#node1">node1</a></a></h2>
+
+<hr>
+<a class="node-id" id="to-node1"></a><div class="nav-panel">
+<p>
+ </p>
+</div>
+<h4 class="node">to <a class="ref" href="#node1"><a class="ref"
href="#to-node1">to <a class="ref" href="#node1">node1</a></a></a></h4>
+</div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+1;
diff --git a/tp/t/results/sectioning/double_recursive_self_section_reference.pl
b/tp/t/results/sectioning/double_recursive_self_section_reference.pl
new file mode 100644
index 0000000000..c37bdb3dcd
--- /dev/null
+++ b/tp/t/results/sectioning/double_recursive_self_section_reference.pl
@@ -0,0 +1,382 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'double_recursive_self_section_reference'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n1'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'n1'
+ }
+ ],
+ 'normalized' => 'n1',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n2'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'label' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n2'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'n2'
+ }
+ ],
+ 'normalized' => 'n2',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ },
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'n2'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {},
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n1'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'label' => {},
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'n1'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[1]{'extra'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'}{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[3] =
$result_trees{'double_recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'};
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'label'}
= $result_trees{'double_recursive_self_section_reference'}{'contents'}[1];
+$result_trees{'double_recursive_self_section_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'double_recursive_self_section_reference'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+
+$result_texis{'double_recursive_self_section_reference'} = '@node n1
+@chapter @ref{n2}
+
+@node n2
+@chapter @ref{n1}
+';
+
+
+$result_texts{'double_recursive_self_section_reference'} = '1 n2
+****
+
+2 n1
+****
+';
+
+$result_sectioning{'double_recursive_self_section_reference'} = {
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'n1'
+ },
+ 'structure' => {}
+ }
+ },
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 1,
+ 'section_up' => {}
+ }
+ },
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'n2'
+ },
+ 'structure' => {}
+ }
+ },
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 2,
+ 'section_prev' => {},
+ 'section_up' => {},
+ 'toplevel_prev' => {}
+ }
+ }
+ ],
+ 'section_level' => 0
+ }
+};
+$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
= $result_sectioning{'double_recursive_self_section_reference'};
+$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[1]{'structure'}{'section_prev'}
=
$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[1]{'structure'}{'section_up'}
= $result_sectioning{'double_recursive_self_section_reference'};
+$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[1]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'double_recursive_self_section_reference'}{'structure'}{'section_childs'}[0];
+
+$result_nodes{'double_recursive_self_section_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {},
+ 'structure' => {
+ 'section_number' => 1
+ }
+ },
+ 'normalized' => 'n1'
+ },
+ 'structure' => {
+ 'node_next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {},
+ 'structure' => {
+ 'section_number' => 2
+ }
+ },
+ 'normalized' => 'n2'
+ },
+ 'structure' => {
+ 'node_prev' => {}
+ }
+ }
+ }
+};
+$result_nodes{'double_recursive_self_section_reference'}{'structure'}{'node_next'}{'structure'}{'node_prev'}
= $result_nodes{'double_recursive_self_section_reference'};
+
+$result_menus{'double_recursive_self_section_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'n1'
+ },
+ 'structure' => {}
+};
+
+$result_errors{'double_recursive_self_section_reference'} = [];
+
+
+$result_floats{'double_recursive_self_section_reference'} = {};
+
+
+
+$result_converted{'plaintext'}->{'double_recursive_self_section_reference'} =
'1 *note n2::
+************
+
+2 *note n1::
+************
+
+';
+
+
+$result_converted{'html'}->{'double_recursive_self_section_reference'} =
'<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#n1" rel="start" title="n1">
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="n1">
+<div class="nav-panel">
+<p>
+Next: <a href="#n2" accesskey="n" rel="next"><a class="ref" href="#n1"><a
class="ref" href="#n2">n2</a></a></a> </p>
+</div>
+<h2 class="chapter" id="n2-1">1 <a class="ref" href="#n2"><a class="ref"
href="#n1"><a class="ref" href="#n2">n2</a></a></a></h2>
+
+<hr>
+</div>
+<div class="chapter-level-extent" id="n2">
+<div class="nav-panel">
+<p>
+Previous: <a href="#n1" accesskey="p" rel="prev"><a class="ref"
href="#n2">n2</a></a> </p>
+</div>
+<h2 class="chapter" id="n1-1">2 <a class="ref" href="#n1"><a class="ref"
href="#n2">n2</a></a></h2>
+</div>
+
+
+
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'double_recursive_self_section_reference'}
= [
+ {
+ 'error_line' => 'warning: must specify a title with a title command or @top
+',
+ 'text' => 'must specify a title with a title command or @top',
+ 'type' => 'warning'
+ }
+];
+
+
+1;
diff --git a/tp/t/results/sectioning/recursive_self_section_reference.pl
b/tp/t/results/sectioning/recursive_self_section_reference.pl
new file mode 100644
index 0000000000..6804000625
--- /dev/null
+++ b/tp/t/results/sectioning/recursive_self_section_reference.pl
@@ -0,0 +1,223 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'recursive_self_section_reference'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'sharp'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'sharp'
+ }
+ ],
+ 'normalized' => 'sharp',
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'sharp'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'label' => {},
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'sharp'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' tuple'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'recursive_self_section_reference'}{'contents'}[1]{'extra'}{'node_content'}[0]
=
$result_trees{'recursive_self_section_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'recursive_self_section_reference'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'recursive_self_section_reference'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'label'}
= $result_trees{'recursive_self_section_reference'}{'contents'}[1];
+$result_trees{'recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'recursive_self_section_reference'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+
+$result_texis{'recursive_self_section_reference'} = '@node sharp
+@chapter @ref{sharp} tuple
+';
+
+
+$result_texts{'recursive_self_section_reference'} = '1 sharp tuple
+*************
+';
+
+$result_sectioning{'recursive_self_section_reference'} = {
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'sharp'
+ }
+ }
+ },
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 1,
+ 'section_up' => {}
+ }
+ }
+ ],
+ 'section_level' => 0
+ }
+};
+$result_sectioning{'recursive_self_section_reference'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
= $result_sectioning{'recursive_self_section_reference'};
+
+$result_nodes{'recursive_self_section_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {},
+ 'structure' => {
+ 'section_number' => 1
+ }
+ },
+ 'normalized' => 'sharp'
+ }
+};
+
+$result_menus{'recursive_self_section_reference'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'sharp'
+ }
+};
+
+$result_errors{'recursive_self_section_reference'} = [];
+
+
+$result_floats{'recursive_self_section_reference'} = {};
+
+
+
+$result_converted{'plaintext'}->{'recursive_self_section_reference'} = '1
*note sharp:: tuple
+*********************
+
+';
+
+
+$result_converted{'html'}->{'recursive_self_section_reference'} = '<!DOCTYPE
html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#sharp" rel="start" title="sharp">
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="sharp">
+<h2 class="chapter" id="sharp-tuple">1 <a class="ref" href="#sharp">sharp</a>
tuple</h2>
+</div>
+
+
+
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'recursive_self_section_reference'} = [
+ {
+ 'error_line' => 'warning: must specify a title with a title command or @top
+',
+ 'text' => 'must specify a title with a title command or @top',
+ 'type' => 'warning'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch release/7.0 updated: * tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands) (_initialize_output_state): add 'referred_command_stack' to put commands that can be referred to being expanded, to catch if an @*ref refers to that command during the expansion, leading to an infinite recursion. In that case, use the node instead of the section, as with nodes only it is not possible to construct a an infinite recursion as the node must both be a reference target and refer to a specific target at the same [...],
Gavin D. Smith <=
- Prev by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands) (_initialize_output_state): add 'referred_command_stack' to put commands that can be referred to being expanded, to catch if an @*ref refers to that command during the expansion, leading to an infinite recursion. In that case, use the node instead of the section, as with nodes only it is not possible to construct a an infinite recursion as the node must both be a reference target and refer to a specific target at the same [...]
- Next by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_gather_previous_item), * tp/Texinfo/XS/parsetexi/multitable.c (gather_previous_item): Include index entries in table_term element. * tp/Texinfo/Common.pm (_relate_index_entry_to_table_entry): Look for index command in table_term rather than table_item.
- Previous by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (command_text, _convert_xref_commands) (_initialize_output_state): add 'referred_command_stack' to put commands that can be referred to being expanded, to catch if an @*ref refers to that command during the expansion, leading to an infinite recursion. In that case, use the node instead of the section, as with nodes only it is not possible to construct a an infinite recursion as the node must both be a reference target and refer to a specific target at the same [...]
- Next by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_gather_previous_item), * tp/Texinfo/XS/parsetexi/multitable.c (gather_previous_item): Include index entries in table_term element. * tp/Texinfo/Common.pm (_relate_index_entry_to_table_entry): Look for index command in table_term rather than table_item.
- Index(es):