[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 29 Jul 2022 10:32:12 -0400 (EDT) |
branch: master
commit 7cdbbc649526d50612e30dfd67cb7aa10a84c970
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jul 29 16:29:48 2022 +0200
Fix NO_TOP_NODE_OUTPUT and title page formatting reference
* tp/Texinfo/Convert/HTML.pm (register_footnote)
(_convert_printindex_command): really skip footnotes and
index entries in Top node when NO_TOP_NODE_OUTPUT is set.
* tp/Texinfo/Convert/HTML.pm (_convert_printindex_command):
do not output letters that have no index entries associated.
* tp/Texinfo/Convert/HTML.pm (_default_format_title_titlepage):
(%available_converter_info, output, convert): replace
_print_title by format_title_titlepage formatting reference.
Call format_title_titlepage after setting the
current_filename, but before starting to format the document. The
title based on @titlepage or simpletitle formatted by
format_title_titlepage is a new global info 'title_titlepage'.
---
ChangeLog | 19 ++
doc/customization_api.texi | 23 ++-
tp/Texinfo/Convert/HTML.pm | 197 +++++++++++++--------
.../references_to_top_no_top_output.pl | 14 --
.../res_html/chapter.html | 7 -
.../res_html/index.html | 7 -
.../index_special_region_html/index.html | 18 +-
.../index.html | 18 +-
.../index_special_region_no_region_html/index.html | 18 +-
9 files changed, 182 insertions(+), 139 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d71a959545..f576c8f9e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2022-07-29 Patrice Dumas <pertusus@free.fr>
+
+ Fix NO_TOP_NODE_OUTPUT and title page formatting reference
+
+ * tp/Texinfo/Convert/HTML.pm (register_footnote)
+ (_convert_printindex_command): really skip footnotes and
+ index entries in Top node when NO_TOP_NODE_OUTPUT is set.
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_printindex_command):
+ do not output letters that have no index entries associated.
+
+ * tp/Texinfo/Convert/HTML.pm (_default_format_title_titlepage):
+ (%available_converter_info, output, convert): replace
+ _print_title by format_title_titlepage formatting reference.
+ Call format_title_titlepage after setting the
+ current_filename, but before starting to format the document. The
+ title based on @titlepage or simpletitle formatted by
+ format_title_titlepage is a new global info 'title_titlepage'.
+
2022-07-29 Gavin Smith <gavinsmith0123@gmail.com>
More isolation for @r
diff --git a/doc/customization_api.texi b/doc/customization_api.texi
index 273fe88226..62c154cac9 100644
--- a/doc/customization_api.texi
+++ b/doc/customization_api.texi
@@ -1609,6 +1609,11 @@ which points to the top level sectioning command tree
element, and
@code{sections_list} which holds the list of the sectioning commands in the
document.
+@item title_titlepage
+The formatted title, possibly based on @code{@@titlepage}, or on
+@code{simpletitle_tree} and similar information, depending on @code{SHOW_TITLE}
+and @code{USE_TITLEPAGE_FOR_TITLE} customization variables in the default case.
+
@end table
@xref{Simple Customization of CSS} for an explanation on getting
@@ -3427,7 +3432,7 @@ the @code{</body>} element.
@node HTML Title Page Customization
@section HTML Title Page Customization
-@cindex Title page, cusstomization
+@cindex Title page, customization
If @code{SHOW_TITLE} is not set, no title is output. @code{SHOW_TITLE} is
@samp{undef}
in the default case. If @samp{undef}, @code{SHOW_TITLE} is set if
@code{NO_TOP_NODE_OUTPUT}
@@ -3435,8 +3440,16 @@ is set. The ``title page'' is used to format the HTML
title if @code{USE_TITLEP
is set, otherwise the @code{simpletitle} is used.
@code{USE_TITLEPAGE_FOR_TITLE}
is set in the default case. @xref{HTML Customization Variables,,, texinfo,
Texinfo}.
-The following function reference provides full control on the ``title page''
-formatting:
+The following functions references provides full control on the title and
+``title page'' formatting:
+
+@deftypefn {Function Reference} $title_titlepage format_title_titlepage
($converter)
+Returns the formatted title or ``title page'' text.
+
+In the default case, return nothing if @code{SHOW_TITLE} is not set, return the
+output of @code{format_titlepage} if @code{USE_TITLEPAGE_FOR_TITLE} is set, and
+otherwise output a simple title based on @code{simpletitle}.
+@end deftypefn
@deftypefn {Function Reference} $title_page format_titlepage ($converter)
Returns the formatted ``title page'' text.
@@ -3445,10 +3458,6 @@ In the default case, the @code{@@titlepage} is used if
found in global informati
otherwise @code{simpletitle} is used (@pxref{Conversion General Information}).
@end deftypefn
-If @code{USE_TITLEPAGE_FOR_TITLE} is set but there is no output of
-@code{format_titlepage} the default formatting reference falls back to
-@code{simpletitle}.
-
@node Customizing CSS
@section Customizing the CSS lines
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index def080f1a3..3b83217fb2 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1413,8 +1413,12 @@ sub register_footnote($$$$$$$)
{
my ($self, $command, $footid, $docid, $number_in_doc,
$footnote_location_filename, $multi_expanded_region) = @_;
- push @{$self->{'pending_footnotes'}}, [$command, $footid, $docid,
- $number_in_doc, $footnote_location_filename, $multi_expanded_region];
+ my $in_skipped_node_top
+ = $self->shared_conversion_state('in_skipped_node_top', 0);
+ if ($$in_skipped_node_top != 1) {
+ push @{$self->{'pending_footnotes'}}, [$command, $footid, $docid,
+ $number_in_doc, $footnote_location_filename, $multi_expanded_region];
+ }
}
sub get_pending_footnotes($)
@@ -1544,7 +1548,7 @@ foreach my $converter_info ('copying_comment',
'current_filename',
'index_entries', 'index_entries_by_letter',
'jslicenses', 'line_break_element', 'non_breaking_space',
'paragraph_symbol',
'simpletitle_command_name', 'simpletitle_tree', 'structuring',
- 'title_string', 'title_tree') {
+ 'title_string', 'title_tree', 'title_titlepage') {
$available_converter_info{$converter_info} = 1;
}
@@ -3499,7 +3503,8 @@ sub _default_format_element_header($$$$)
my $first_in_page = (defined($tree_unit->{'structure'}->{'unit_filename'})
and $self->count_elements_in_filename('current',
$tree_unit->{'structure'}->{'unit_filename'}) == 1);
- my $previous_is_top = ($tree_unit->{'structure'}->{'unit_prev'}
+ my $previous_is_top = 0;
+ $previous_is_top = 1 if ($tree_unit->{'structure'}->{'unit_prev'}
and
$self->element_is_tree_unit_top($tree_unit->{'structure'}->{'unit_prev'}));
print STDERR "Header ($previous_is_top, $is_top, $first_in_page): "
@@ -4965,21 +4970,20 @@ sub _convert_printindex_command($$$$)
$self->_new_document_context($cmdname);
- # First do the summary letters linking to the letters done below
my %letter_id;
- my @non_alpha = ();
- my @alpha = ();
- # collect the links
+ my %letter_is_symbol;
+ # First collect the links that are used in entries and in letter summaries
my $symbol_idx = 0;
foreach my $letter_entry (@{$index_entries_by_letter->{$index_name}}) {
my $letter = $letter_entry->{'letter'};
my $index_element_id = $self->from_element_direction('This', 'target');
if (!defined($index_element_id)) {
# to avoid duplicate names, use a prefix that cannot happen in anchors
- my $target_prefix = "t_i";
+ my $target_prefix = 't_i';
$index_element_id = $target_prefix;
}
my $is_symbol = $letter !~ /^\p{Alpha}/;
+ $letter_is_symbol{$letter} = $is_symbol;
my $identifier;
if ($is_symbol) {
$symbol_idx++;
@@ -4988,51 +4992,11 @@ sub _convert_printindex_command($$$$)
$identifier = $index_element_id . "_${index_name}_letter-${letter}";
}
$letter_id{$letter} = $identifier;
-
- my $summary_letter_link
- = $self->html_attribute_class('a',["summary-letter-$cmdname"])
- ." href=\"#$identifier\"><b>".
- &{$self->formatting_function('format_protect_text')}($self, $letter)
- .'</b></a>';
- if ($is_symbol) {
- push @non_alpha, $summary_letter_link;
- } else {
- push @alpha, $summary_letter_link;
- }
}
- # Format the summary letters
- my $join = '';
- my $non_alpha_text = '';
- my $alpha_text = '';
- my $non_breaking_space = $self->get_info('non_breaking_space');
- $join = " $non_breaking_space \n".$self->get_info('line_break_element')."\n"
- if (@non_alpha and @alpha);
- if (@non_alpha) {
- $non_alpha_text = join("\n $non_breaking_space \n", @non_alpha) . "\n";
- }
- if (@alpha) {
- $alpha_text = join("\n $non_breaking_space \n", @alpha)
- . "\n $non_breaking_space \n";
- }
- my $result = $self->html_attribute_class('div',
- [$cmdname, "$index_name-$cmdname"]).">\n";
- # format the summary
- my $summary_header = $self->html_attribute_class('table',
- ["$index_name-letters-header-$cmdname"]).'><tr><th valign="top">'
- . $self->convert_tree($self->gdt('Jump to')) .": $non_breaking_space
</th><td>" .
- $non_alpha_text . $join . $alpha_text . "</td></tr></table>\n";
-
- $result .= $summary_header;
-
- # now format the index entries
- $result .= $self->html_attribute_class('table',
["$index_name-entries-$cmdname"])
- ." border=\"0\">\n" . "<tr><td></td><th align=\"left\">"
- . $self->convert_tree($self->gdt('Index Entry'))
- . "</th><td>$non_breaking_space</td><th align=\"left\"> "
- . $self->convert_tree($self->gdt('Section'))
- ."</th></tr>\n" . "<tr><td colspan=\"4\"> ".$self->get_conf('DEFAULT_RULE')
- ."</td></tr>\n";
+ # Next do the entries to determine the letters that are not empty
+ my @letter_entries;
+ my $result_index_entries = '';
my $formatted_index_entries
= $self->shared_conversion_state('formatted_index_entries', {});
foreach my $letter_entry (@{$index_entries_by_letter->{$index_name}}) {
@@ -5068,6 +5032,11 @@ sub _convert_printindex_command($$$$)
}
next if ($entry !~ /\S/);
+ next if ($self->get_conf('NO_TOP_NODE_OUTPUT')
+ and defined($index_entry_ref->{'node'})
+ and $index_entry_ref->{'node'}->{'extra'}
+ and $index_entry_ref->{'node'}->{'extra'}->{'normalized'}
+ and $index_entry_ref->{'node'}->{'extra'}->{'normalized'} eq
'Top');
$entry = '<code>' .$entry .'</code>' if ($index_entry_ref->{'in_code'});
my $entry_href = $self->command_href($index_entry_ref->{'command'});
my $associated_command;
@@ -5100,16 +5069,69 @@ sub _convert_printindex_command($$$$)
'</td><td>'.$self->get_info('non_breaking_space').'</td><td
valign="top">';
$entries_text .= "<a
href=\"$associated_command_href\">$associated_command_text</a>"
if ($associated_command_href);
- $entries_text .= "</td></tr>\n";
+ $entries_text .= "</td></tr>\n";
}
# a letter and associated indice entries
- $result .= '<tr>' .
- "<th id=\"$letter_id{$letter}\">".
- &{$self->formatting_function('format_protect_text')}($self, $letter)
- . "</th><td></td><td></td></tr>\n" . $entries_text
- . "<tr><td colspan=\"4\">
".$self->get_conf('DEFAULT_RULE')."</td></tr>\n";
+ if ($entries_text ne '') {
+ $result_index_entries .= '<tr>' .
+ "<th id=\"$letter_id{$letter}\">".
+ &{$self->formatting_function('format_protect_text')}($self, $letter)
+ . "</th><td></td><td></td></tr>\n" . $entries_text
+ . "<tr><td colspan=\"4\">
".$self->get_conf('DEFAULT_RULE')."</td></tr>\n";
+ push @letter_entries, $letter_entry;
+ }
+ }
+ # Do the summary letters linking to the letters done above
+ my @non_alpha = ();
+ my @alpha = ();
+ foreach my $letter_entry (@letter_entries) {
+ my $letter = $letter_entry->{'letter'};
+ my $summary_letter_link
+ = $self->html_attribute_class('a',["summary-letter-$cmdname"])
+ ." href=\"#$letter_id{$letter}\"><b>".
+ &{$self->formatting_function('format_protect_text')}($self, $letter)
+ .'</b></a>';
+ if ($letter_is_symbol{$letter}) {
+ push @non_alpha, $summary_letter_link;
+ } else {
+ push @alpha, $summary_letter_link;
+ }
}
+ # Format the summary letters
+ my $join = '';
+ my $non_alpha_text = '';
+ my $alpha_text = '';
+ my $non_breaking_space = $self->get_info('non_breaking_space');
+ $join = " $non_breaking_space \n".$self->get_info('line_break_element')."\n"
+ if (@non_alpha and @alpha);
+ if (@non_alpha) {
+ $non_alpha_text = join("\n $non_breaking_space \n", @non_alpha) . "\n";
+ }
+ if (@alpha) {
+ $alpha_text = join("\n $non_breaking_space \n", @alpha)
+ . "\n $non_breaking_space \n";
+ }
+ my $result = $self->html_attribute_class('div',
+ [$cmdname, "$index_name-$cmdname"]).">\n";
+ # format the summary
+ my $summary_header = $self->html_attribute_class('table',
+ ["$index_name-letters-header-$cmdname"]).'><tr><th valign="top">'
+ . $self->convert_tree($self->gdt('Jump to')) .": $non_breaking_space
</th><td>" .
+ $non_alpha_text . $join . $alpha_text . "</td></tr></table>\n";
+
+
+ $result .= $summary_header;
+
+ # now format the index entries
+ $result .= $self->html_attribute_class('table',
["$index_name-entries-$cmdname"])
+ ." border=\"0\">\n" . "<tr><td></td><th align=\"left\">"
+ . $self->convert_tree($self->gdt('Index Entry'))
+ . "</th><td>$non_breaking_space</td><th align=\"left\"> "
+ . $self->convert_tree($self->gdt('Section'))
+ ."</th></tr>\n" . "<tr><td colspan=\"4\"> ".$self->get_conf('DEFAULT_RULE')
+ ."</td></tr>\n";
+ $result .= $result_index_entries;
$result .= "</table>\n";
$self->_pop_document_context();
@@ -6235,7 +6257,7 @@ sub _default_format_titlepage($)
return $result;
}
-sub _print_title($)
+sub _default_format_title_titlepage($)
{
my $self = shift;
@@ -6340,7 +6362,7 @@ sub _convert_tree_unit_type($$$$)
my $result = '';
my $tree_unit = $element;
if (!$tree_unit->{'structure'}->{'unit_prev'}) {
- $result .= $self->_print_title();
+ $result .= $self->get_info('title_titlepage');
if (!$tree_unit->{'structure'}->{'unit_next'}) {
# only one unit, use simplified formatting
$result .= $content;
@@ -6532,6 +6554,7 @@ foreach my $customized_reference ('label_target_name',
'node_file_name',
'format_protect_text' => \&_default_format_protect_text,
'format_separate_anchor' => \&_default_format_separate_anchor,
'format_titlepage' => \&_default_format_titlepage,
+ 'format_title_titlepage' => \&_default_format_title_titlepage,
);
# not up for customization
@@ -8590,7 +8613,7 @@ sub _file_header_information($$;$)
if ($command) {
my $command_string = $self->command_text($command, 'string');
if (defined($command_string)
- and $command_string ne $self->{'title_string'}) {
+ and $command_string ne $self->get_info('title_string')) {
my $element_tree;
if ($self->get_conf('SECTION_NAME_IN_TITLE')
and $command->{'extra'}
@@ -9215,6 +9238,10 @@ sub convert($$)
$self->_prepare_index_entries();
$self->_prepare_footnotes();
+ # title
+ $self->{'title_titlepage'}
+ = &{$self->formatting_function('format_title_titlepage')}($self);
+
# complete information should be available.
$self->_reset_info();
@@ -9618,7 +9645,7 @@ sub output($$)
chomp($self->{'documentdescription_string'});
}
- # set information, to have it ready for un_stage_handlers.
+ # set information, to have it ready for run_stage_handlers.
# Some information is not available yet.
$self->_reset_info();
@@ -9631,20 +9658,13 @@ sub output($$)
return undef if (!$status);
}
-
- # complete information should be available.
- $self->_reset_info();
-
- my $fh;
- my $output = '';
-
+ # determine first file name
if (!$tree_units
or !defined($tree_units->[0]->{'structure'}->{'unit_filename'})) {
# no page
- my $no_page_out_filepath;
- my $encoded_no_page_out_filepath;
if ($output_file ne '') {
my $no_page_output_filename;
+ my $no_page_out_filepath;
if ($self->get_conf('SPLIT')) {
$no_page_output_filename = $self->top_node_filename($document_name);
if (defined($destination_directory) and $destination_directory ne '') {
@@ -9657,7 +9677,35 @@ sub output($$)
$no_page_out_filepath = $output_file;
$no_page_output_filename = $output_filename;
}
+ $self->{'out_filepaths'}->{$no_page_output_filename} =
$no_page_out_filepath;
+
+ $self->{'current_filename'} = $no_page_output_filename;
+ } else {
+ $self->{'current_filename'} = $output_filename;
+ }
+ } else {
+ $self->{'current_filename'}
+ = $tree_units->[0]->{'structure'}->{'unit_filename'};
+ }
+ # title
+ $self->{'title_titlepage'}
+ = &{$self->formatting_function('format_title_titlepage')}($self);
+
+ # complete information should be available.
+ $self->_reset_info();
+
+ my $output = '';
+
+ if (!$tree_units
+ or !defined($tree_units->[0]->{'structure'}->{'unit_filename'})) {
+ my $fh;
+ my $encoded_no_page_out_filepath;
+ my $no_page_out_filepath;
+ if ($self->{'current_filename'} ne ''
+ and defined($self->{'out_filepaths'}->{$self->{'current_filename'}})) {
my $path_encoding;
+ $no_page_out_filepath
+ = $self->{'out_filepaths'}->{$self->{'current_filename'}};
($encoded_no_page_out_filepath, $path_encoding)
= $self->encoded_output_file_name($no_page_out_filepath);
$fh = Texinfo::Common::output_files_open_out(
@@ -9669,11 +9717,6 @@ sub output($$)
$no_page_out_filepath, $!));
return undef;
}
- $self->{'out_filepaths'}->{$no_page_output_filename} =
$no_page_out_filepath;
-
- $self->{'current_filename'} = $no_page_output_filename;
- } else {
- $self->{'current_filename'} = $output_filename;
}
my $body = '';
if ($tree_units and @$tree_units) {
@@ -9688,7 +9731,7 @@ sub output($$)
$unit_nr++;
}
} else {
- $body .= $self->_print_title();
+ $body .= $self->get_info('title_titlepage');
print STDERR "\nNO UNIT NO PAGE\n" if ($self->get_conf('DEBUG'));
$body .= $self->_convert($root, 'no-page output no unit');
$body .=
&{$self->formatting_function('format_footnotes_segment')}($self);
diff --git a/tp/t/results/converters_tests/references_to_top_no_top_output.pl
b/tp/t/results/converters_tests/references_to_top_no_top_output.pl
index d4d1542381..8562041aad 100644
--- a/tp/t/results/converters_tests/references_to_top_no_top_output.pl
+++ b/tp/t/results/converters_tests/references_to_top_no_top_output.pl
@@ -1663,8 +1663,6 @@ see <a class="pxref" href="#a-in-caption">a in caption</a>
<div class="printindex cp-printindex">
<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-I"><b>I</b></a>
-
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
@@ -1672,14 +1670,9 @@ see <a class="pxref" href="#a-in-caption">a in
caption</a>
<tr><th id="t_i_cp_letter-C">C</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-chap-index">chap
index</a>:</td><td> </td><td valign="top"><a
href="#chapter">chapter</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="t_i_cp_letter-I">I</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-index-in-Top">index in
Top</a>:</td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
</table>
<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-I"><b>I</b></a>
-
</td></tr></table>
</div>
@@ -1692,13 +1685,6 @@ see <a class="pxref" href="#a-in-caption">a in
caption</a>
<dt><a href="#Main-Flist">list 1.1</a></dt><dd
class="caption-in-listoffloats"><p>Caption Main</p></dd>
</dl>
</div>
-<div class="footnotes-segment">
-<hr>
-<h4 class="footnotes-heading">Footnotes</h4>
-
-<h5 class="footnote-body-heading"><a id="FOOT1" href="#DOCF1">(1)</a></h5>
-<p>in footnote <a class="anchor" id="a-in-footnote"></a></p>
-</div>
';
1;
diff --git
a/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/chapter.html
b/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/chapter.html
index 277d9adb59..17226d0e2e 100644
---
a/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/chapter.html
+++
b/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/chapter.html
@@ -45,8 +45,6 @@ see <a class="pxref" href="index.html#a-in-caption">a in
caption</a>
<div class="printindex cp-printindex">
<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#chapter_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#chapter_cp_letter-I"><b>I</b></a>
-
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
@@ -54,14 +52,9 @@ see <a class="pxref" href="index.html#a-in-caption">a in
caption</a>
<tr><th id="chapter_cp_letter-C">C</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-chap-index">chap
index</a>:</td><td> </td><td valign="top"><a
href="#chapter">chapter</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="chapter_cp_letter-I">I</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="index.html#index-index-in-Top">index in
Top</a>:</td><td> </td><td valign="top"><a
href="index.html">Top</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
</table>
<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#chapter_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#chapter_cp_letter-I"><b>I</b></a>
-
</td></tr></table>
</div>
diff --git
a/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/index.html
b/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/index.html
index 32ac855a61..be1bd8d1f8 100644
---
a/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/index.html
+++
b/tp/t/results/converters_tests/references_to_top_no_top_output/res_html/index.html
@@ -30,13 +30,6 @@ Next: <a href="chapter.html" accesskey="n"
rel="next">Chap</a> [<a href="
<a class="top" id="top"></a><ul class="mini-toc">
<li><a href="chapter.html" accesskey="1">Chap</a></li>
</ul>
-<div class="footnotes-segment">
-<hr>
-<h4 class="footnotes-heading">Footnotes</h4>
-
-<h5 class="footnote-body-heading"><a id="FOOT1" href="#DOCF1">(1)</a></h5>
-<p>in footnote <a class="anchor" id="a-in-footnote"></a></p>
-</div>
<hr>
<div class="nav-panel">
<p>
diff --git a/tp/tests/indices/res_parser/index_special_region_html/index.html
b/tp/tests/indices/res_parser/index_special_region_html/index.html
index 7f6a9021d8..dec6c29882 100644
--- a/tp/tests/indices/res_parser/index_special_region_html/index.html
+++ b/tp/tests/indices/res_parser/index_special_region_html/index.html
@@ -41,33 +41,33 @@ span.program-in-footer {font-size: smaller}
domain<a class="footnote" id="DOCF1"
href="index_special_region_fot.html#FOOT1"><sup>2</sup></a>.
</p>
<div class="printindex cp-printindex">
-<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-C">C</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-C">C</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="Copying-and-indices.html#index-Copying-appendix">Copying
appendix</a></td><td> </td><td valign="top"><a
href="Copying-and-indices.html">Appendix A Copying and indices</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-copying-Copying-this-document">Copying this
document</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-P">P</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-P">P</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_fot.html#index-copying-Public-domain">Public
domain</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-T">T</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-T">T</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_fot.html#index-titlepage-Titlepage-footnote">Titlepage
footnote</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-titlepage-Titlepage-index">Titlepage
index</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
-<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
</div>
diff --git
a/tp/tests/indices/res_parser/index_special_region_no_insertcopying_html/index.html
b/tp/tests/indices/res_parser/index_special_region_no_insertcopying_html/index.html
index 863776010c..779e6b48cf 100644
---
a/tp/tests/indices/res_parser/index_special_region_no_insertcopying_html/index.html
+++
b/tp/tests/indices/res_parser/index_special_region_no_insertcopying_html/index.html
@@ -41,33 +41,33 @@ span.program-in-footer {font-size: smaller}
domain<a class="footnote" id="DOCF1"
href="index_special_region_no_insertcopying_fot.html#FOOT1"><sup>2</sup></a>.
</p>
<div class="printindex cp-printindex">
-<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-C">C</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-C">C</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="Copying-and-indices.html#index-Copying-appendix">Copying
appendix</a></td><td> </td><td valign="top"><a
href="Copying-and-indices.html">Appendix A Copying and indices</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-copying-Copying-this-document">Copying this
document</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-P">P</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-P">P</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_no_insertcopying_fot.html#index-copying-Public-domain">Public
domain</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-T">T</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-T">T</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_no_insertcopying_fot.html#index-titlepage-Titlepage-footnote">Titlepage
footnote</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-titlepage-Titlepage-index">Titlepage
index</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
-<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
</div>
diff --git
a/tp/tests/indices/res_parser/index_special_region_no_region_html/index.html
b/tp/tests/indices/res_parser/index_special_region_no_region_html/index.html
index 9d768c37cd..43197c8d6e 100644
--- a/tp/tests/indices/res_parser/index_special_region_no_region_html/index.html
+++ b/tp/tests/indices/res_parser/index_special_region_no_region_html/index.html
@@ -41,33 +41,33 @@ span.program-in-footer {font-size: smaller}
domain<a class="footnote" id="DOCF1"
href="index_special_region_no_region_fot.html#FOOT1"><sup>2</sup></a>.
</p>
<div class="printindex cp-printindex">
-<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-header-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-C">C</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-C">C</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="Copying-and-indices.html#index-Copying-appendix">Copying
appendix</a></td><td> </td><td valign="top"><a
href="Copying-and-indices.html">Appendix A Copying and indices</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-copying-Copying-this-document">Copying this
document</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-P">P</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-P">P</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_no_region_fot.html#index-copying-Public-domain">Public
domain</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Top-1_cp_letter-T">T</th><td></td><td></td></tr>
+<tr><th id="t_i_cp_letter-T">T</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="index_special_region_no_region_fot.html#index-titlepage-Titlepage-footnote">Titlepage
footnote</a></td><td> </td><td valign="top"><a
href="#Top">Top</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-titlepage-Titlepage-index">Titlepage
index</a></td><td> </td><td valign="top"><a href="#Top">Top</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
-<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top-1_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-footer-printindex"><tr><th valign="top">Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-P"><b>P</b></a>
-<a class="summary-letter-printindex" href="#Top-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
</td></tr></table>
</div>