[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 17 Feb 2024 17:23:48 -0500 (EST) |
branch: master
commit 3280621dd3dc47a9dcd4a620b038a9ed8b47cae8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 17 23:09:56 2024 +0100
* doc/texi2any_api.texi (Dynamic Converter Formatting Information),
tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
(current_output_unit), tp/Texinfo/XS/convert/ConvertXS.xs
(html_current_output_unit), tp/Texinfo/XS/convert/convert_html.c
(convert_output_unit), tp/Texinfo/XS/convert/build_html_perl_state.c
(build_html_formatting_state): add a function accessor for
convert_output_unit. Add an XS override for the. Do not pass
current_output_unit through build_html_formatting_state anymore, the
accessor function should be always be used instead.
* tp/Texinfo/Convert/HTML.pm (_convert_printindex_command),
tp/Texinfo/XS/convert/convert_html (convert_printindex_command):
instead of calling from_element_direction('This', 'target'), call
directly command_id on current_output_unit unit_command.
---
ChangeLog | 17 +++++++++++++++
doc/texi2any_api.texi | 6 ++++++
tp/Texinfo/Convert/HTML.pm | 23 ++++++++++++++++-----
tp/Texinfo/XS/convert/ConvertXS.xs | 13 ++++++++++++
tp/Texinfo/XS/convert/build_html_perl_state.c | 9 --------
tp/Texinfo/XS/convert/convert_html.c | 10 ++++-----
tp/Texinfo/XS/main/utils.h | 2 +-
.../indices/index_no_node_no_top_no_node.pl | 24 +++++++++++-----------
.../indices/printindex_between_part_chapter.pl | 18 ++++++++--------
.../indices/printindex_index_entry_in_copying.pl | 18 ++++++++--------
...rintindex_index_entry_in_copying_in_footnote.pl | 2 +-
11 files changed, 91 insertions(+), 51 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3c8e460cd7..05bdd1c527 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2024-02-17 Patrice Dumas <pertusus@free.fr>
+
+ * doc/texi2any_api.texi (Dynamic Converter Formatting Information),
+ tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
+ (current_output_unit), tp/Texinfo/XS/convert/ConvertXS.xs
+ (html_current_output_unit), tp/Texinfo/XS/convert/convert_html.c
+ (convert_output_unit), tp/Texinfo/XS/convert/build_html_perl_state.c
+ (build_html_formatting_state): add a function accessor for
+ convert_output_unit. Add an XS override for the. Do not pass
+ current_output_unit through build_html_formatting_state anymore, the
+ accessor function should be always be used instead.
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_printindex_command),
+ tp/Texinfo/XS/convert/convert_html (convert_printindex_command):
+ instead of calling from_element_direction('This', 'target'), call
+ directly command_id on current_output_unit unit_command.
+
2024-02-17 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (_contents_inline_element),
diff --git a/doc/texi2any_api.texi b/doc/texi2any_api.texi
index 506a72f21a..583a33c1de 100644
--- a/doc/texi2any_api.texi
+++ b/doc/texi2any_api.texi
@@ -2981,6 +2981,12 @@ preformatted containers and @@-commands such as
@code{@@abbr}, @code{@@footnote}
@node Dynamic Converter Formatting Information
@section Dynamic Converter Formatting Information
+To get the current output unit being converted, use @code{current_output_unit}:
+@deftypefun {@var{$output_unit} =} @var{$converter}->current_output_unit ()
+Return the output unit being converted, or @code{undef} if there is no
+output unit.
+@end deftypefun
+
To get the file name of the current output unit being converted,
use @code{current_filename}:
@deftypefun {@var{$filename} =} @var{$converter}->current_filename ()
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 6b8d2ea342..e9e39b1e04 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -221,6 +221,8 @@ my %XS_conversion_overrides = (
=> "Texinfo::Convert::ConvertXS::html_in_align",
"Texinfo::Convert::HTML::current_filename"
=> "Texinfo::Convert::ConvertXS::html_current_filename",
+ "Texinfo::Convert::HTML::current_output_unit"
+ => "Texinfo::Convert::ConvertXS::html_current_output_unit",
"Texinfo::Convert::HTML::count_elements_in_filename"
=> "Texinfo::Convert::ConvertXS::html_count_elements_in_filename",
@@ -1580,14 +1582,14 @@ foreach my $no_number_type ('text', 'string') {
#
# This is used both for output units and external nodes
#
-# If $SOURCE_UNIT is undef, $self->{'current_output_unit'} is used.
+# If $SOURCE_UNIT is undef, $self->current_output_unit() is used.
#
# $SOURCE_FOR_MESSAGES is an element used for messages formatting, to get a
# location in input file. It is better to choose the node and not the
# sectioning command associated with the element, as the error messages
# are about external nodes not found.
#
-# $self->{'current_output_unit'} undef happens at least when there is no
+# $self->current_output_unit() undef happens at least when there is no
# output file. That call would result for instance from from_element_direction
# being called from _get_links, itself called from 'format_begin_file'.
# TODO are there other cases?
@@ -1604,7 +1606,7 @@ sub from_element_direction($$$;$$$)
my $target_unit;
my $command;
- $source_unit = $self->{'current_output_unit'} if (!defined($source_unit));
+ $source_unit = $self->current_output_unit() if (!defined($source_unit));
# NOTE $source_filename is only used for a command_href call. If with XS,
# if source_filename remains undef, the command_href XS code will set the
# source_filename to the current filename in XS. Therefore undef
@@ -2341,6 +2343,12 @@ sub current_filename($)
return $self->{'current_filename'};
}
+sub current_output_unit($)
+{
+ my $self = shift;
+ return $self->{'current_output_unit'};
+}
+
# information from converter available 'read-only', set up before
# really starting the formatting.
# 'document' is set up in the generic converter
@@ -6306,7 +6314,12 @@ sub _convert_printindex_command($$$$)
# print STDERR " ".join('|', keys(%$index_entry))."|||
$index_entry->{'key'}\n";
# }
#}
- my $index_element_id = $self->from_element_direction('This', 'target');
+ my $index_element_id;
+ my $current_output_unit = $self->current_output_unit();
+ if ($current_output_unit and $current_output_unit->{'unit_command'}) {
+ $index_element_id
+ = $self->command_id ($current_output_unit->{'unit_command'});
+ }
if (!defined($index_element_id)) {
my ($root_element, $root_command)
= $self->get_element_root_command_element($command);
@@ -8627,6 +8640,7 @@ sub _load_htmlxref_files {
#
# API exists
# current_filename
+# current_output_unit
# document_name
# destination_directory
# paragraph_symbol
@@ -8705,7 +8719,6 @@ sub _load_htmlxref_files {
# No API, converter internals
# document_units
# out_filepaths (partially common with Texinfo::Converter)
-# current_output_unit
# seen_ids
# ignore_notice
# options_latex_math
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 8d3f191b00..ef4dca5ca1 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -830,6 +830,19 @@ html_current_filename (SV *converter_in)
OUTPUT:
RETVAL
+SV *
+html_current_output_unit (SV *converter_in)
+ PREINIT:
+ CONVERTER *self;
+ CODE:
+ self = get_sv_converter (converter_in, "html_current_output_unit");
+ if (!self->current_output_unit)
+ RETVAL = newSV (0);
+ else
+ RETVAL = newRV_inc ((SV *) self->current_output_unit->hv);
+ OUTPUT:
+ RETVAL
+
SV *
html_count_elements_in_filename (SV *converter_in, char *spec, filename)
char *filename = (char *)SvPVutf8_nolen($arg);
diff --git a/tp/Texinfo/XS/convert/build_html_perl_state.c
b/tp/Texinfo/XS/convert/build_html_perl_state.c
index a94b237ed5..ed0799d068 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_state.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_state.c
@@ -398,15 +398,6 @@ build_html_formatting_state (CONVERTER *converter,
unsigned long flags)
newRV_inc ((SV *) converter->current_node->hv));
}
- if (flags & HMSF_current_output_unit)
- {
- if (!converter->current_output_unit)
- STORE("current_output_unit", newSV (0));
- else
- STORE("current_output_unit",
- newRV_inc ((SV *) converter->current_output_unit->hv));
- }
-
if (flags & HMSF_multiple_pass)
{
SV **multiple_pass_sv;
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index b9a7ca2b56..0b64da0f63 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -12460,7 +12460,7 @@ convert_printindex_command (CONVERTER *self, const enum
command_id cmd,
const char *index_name;
INDEX_SORTED_BY_LETTER *idx;
INDEX_SORTED_BY_LETTER *index_sorted = 0;
- const char *index_element_id;
+ const char *index_element_id = 0;
char **letter_id;
char **alpha;
char **non_alpha;
@@ -12509,8 +12509,10 @@ convert_printindex_command (CONVERTER *self, const
enum command_id cmd,
if (!index_sorted || !index_sorted->letter_number)
return;
- index_element_id = from_element_direction (self, D_direction_This,
- HTT_target, 0, 0, 0);
+ if (self->current_output_unit && self->current_output_unit->unit_command)
+ index_element_id
+ = html_command_id (self, self->current_output_unit->unit_command);
+
if (!index_element_id)
{
ROOT_AND_UNIT *root_unit
@@ -18205,7 +18207,6 @@ convert_output_unit (CONVERTER *self, const OUTPUT_UNIT
*output_unit,
}
self->current_output_unit = output_unit;
- self->modified_state |= HMSF_current_output_unit;
text_init (&content_formatted);
text_append (&content_formatted, "");
@@ -18240,7 +18241,6 @@ convert_output_unit (CONVERTER *self, const OUTPUT_UNIT
*output_unit,
free (content_formatted.text);
self->current_output_unit = 0;
- self->modified_state |= HMSF_current_output_unit;
if (self->conf->DEBUG.integer > 0)
fprintf (stderr, "DOUNIT (%s) => `%s'\n",
output_unit_type_names[unit_type],
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index adf6dbfe19..095689c529 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -109,8 +109,8 @@ enum command_location {
#define HMSF_ 0x0100
*/
#define HMSF_current_node 0x0200
-#define HMSF_current_output_unit 0x0400
/*
+#define HMSF_ 0x0400
#define HMSF_ 0x0800
*/
#define HMSF_ignore_notice 0x1000
diff --git a/tp/t/results/indices/index_no_node_no_top_no_node.pl
b/tp/t/results/indices/index_no_node_no_top_no_node.pl
index f1d46b44cc..cdf3e2c80b 100644
--- a/tp/t/results/indices/index_no_node_no_top_no_node.pl
+++ b/tp/t/results/indices/index_no_node_no_top_no_node.pl
@@ -1805,27 +1805,27 @@
$result_converted_errors{'plaintext'}->{'index_no_node_no_top_no_node'} = [
$result_converted{'html_text'}->{'index_no_node_no_top_no_node'} = '<a
class="index-entry-id" id="index-truc"></a>
<p>Garbage
</p><div class="printindex cp-printindex">
-<table class="cp-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#unnumbered_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-S"><b>S</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-S"><b>S</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-T"><b>T</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-U"><b>U</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-U"><b>U</b></a>
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th
class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="t_i_cp_letter-C">C</th></tr>
+<tr><th id="unnumbered_cp_letter-C">C</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-chapter">chapter</a></td><td class="printindex-index-section"><a
href="#Chapter">1 Chapter</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-Chapter2">Chapter2</a></td><td class="printindex-index-section"><a
href="#Chapter">1 Chapter</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="t_i_cp_letter-S">S</th></tr>
+<tr><th id="unnumbered_cp_letter-S">S</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-second">second</a></td><td class="printindex-index-section"><a
href="#second">second</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-second-1">second</a></td><td class="printindex-index-section"><a
href="#second">second</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="t_i_cp_letter-T">T</th></tr>
+<tr><th id="unnumbered_cp_letter-T">T</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top-section">top section</a></td><td
class="printindex-index-section"><a href="#top-_0028chapter_0029-section">top
(chapter) section</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top-section-1">top section</a></td><td
class="printindex-index-section"><a href="#top-_0028chapter_0029-section">top
(chapter) section</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top-section-2">top section</a></td><td
class="printindex-index-section"><a href="#top-_0028chapter_0029-section">top
(chapter) section</a></td></tr>
@@ -1835,18 +1835,18 @@
$result_converted{'html_text'}->{'index_no_node_no_top_no_node'} = '<a class="in
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top-section1">top section1</a></td><td
class="printindex-index-section"><a href="#top-_0028chapter_0029-section">top
(chapter) section</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-truc">truc</a></td><td class="printindex-index-section"><a
href="#unnumbered">unnumbered</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="t_i_cp_letter-U">U</th></tr>
+<tr><th id="unnumbered_cp_letter-U">U</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-unnumbered">unnumbered</a></td><td
class="printindex-index-section"><a href="#unnumbered">unnumbered</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-unnumbered-after-text">unnumbered after text</a></td><td
class="printindex-index-section"><a href="#unnumbered">unnumbered</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
-<table class="cp-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#t_i_cp_letter-C"><b>C</b></a>
+<table class="cp-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#unnumbered_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-S"><b>S</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-S"><b>S</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-T"><b>T</b></a>
-<a class="summary-letter-printindex" href="#t_i_cp_letter-U"><b>U</b></a>
+<a class="summary-letter-printindex"
href="#unnumbered_cp_letter-U"><b>U</b></a>
</td></tr></table>
</div>
diff --git a/tp/t/results/indices/printindex_between_part_chapter.pl
b/tp/t/results/indices/printindex_between_part_chapter.pl
index 82cac60387..3b34232a05 100644
--- a/tp/t/results/indices/printindex_between_part_chapter.pl
+++ b/tp/t/results/indices/printindex_between_part_chapter.pl
@@ -861,34 +861,34 @@
$result_converted{'html_text'}->{'printindex_between_part_chapter'} = '<div clas
<hr>
<div class="printindex cp-printindex">
-<table class="cp-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Part-1_cp_letter-A"><b>A</b></a>
+<table class="cp-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#node-chap1_cp_letter-A"><b>A</b></a>
-<a class="summary-letter-printindex" href="#Part-1_cp_letter-C"><b>C</b></a>
+<a class="summary-letter-printindex"
href="#node-chap1_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Part-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex"
href="#node-chap1_cp_letter-T"><b>T</b></a>
</td></tr></table>
<table class="cp-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th
class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Part-1_cp_letter-A">A</th></tr>
+<tr><th id="node-chap1_cp_letter-A">A</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-aop1">aop1</a></td><td class="printindex-index-section"><a
href="#Top">Top</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-aop1-1">aop1</a></td><td class="printindex-index-section"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Part-1_cp_letter-C">C</th></tr>
+<tr><th id="node-chap1_cp_letter-C">C</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-chap2">chap2</a></td><td class="printindex-index-section"><a
href="#node-chap2">node chap2</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-chap2-1">chap2</a></td><td class="printindex-index-section"><a
href="#node-chap2">node chap2</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Part-1_cp_letter-T">T</th></tr>
+<tr><th id="node-chap1_cp_letter-T">T</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top1">top1</a></td><td class="printindex-index-section"><a
href="#Top">Top</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-top1-1">top1</a></td><td class="printindex-index-section"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
-<table class="cp-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Part-1_cp_letter-A"><b>A</b></a>
+<table class="cp-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#node-chap1_cp_letter-A"><b>A</b></a>
-<a class="summary-letter-printindex" href="#Part-1_cp_letter-C"><b>C</b></a>
+<a class="summary-letter-printindex"
href="#node-chap1_cp_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Part-1_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex"
href="#node-chap1_cp_letter-T"><b>T</b></a>
</td></tr></table>
</div>
diff --git a/tp/t/results/indices/printindex_index_entry_in_copying.pl
b/tp/t/results/indices/printindex_index_entry_in_copying.pl
index 4494747390..cd774752e7 100644
--- a/tp/t/results/indices/printindex_index_entry_in_copying.pl
+++ b/tp/t/results/indices/printindex_index_entry_in_copying.pl
@@ -1220,33 +1220,33 @@
$result_converted{'html_text'}->{'printindex_index_entry_in_copying'} = '
</dl>
<div class="printindex fn-printindex">
-<table class="fn-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top_fn_letter-C"><b>C</b></a>
+<table class="fn-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#chapter_fn_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top_fn_letter-F"><b>F</b></a>
+<a class="summary-letter-printindex" href="#chapter_fn_letter-F"><b>F</b></a>
-<a class="summary-letter-printindex" href="#Top_fn_letter-X"><b>X</b></a>
+<a class="summary-letter-printindex" href="#chapter_fn_letter-X"><b>X</b></a>
</td></tr></table>
<table class="fn-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th
class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Top_fn_letter-C">C</th></tr>
+<tr><th id="chapter_fn_letter-C">C</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-Copying-this-document"><code>Copying this
document</code></a></td><td class="printindex-index-section"><a
href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Top_fn_letter-F">F</th></tr>
+<tr><th id="chapter_fn_letter-F">F</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-ftable-item"><code>ftable item</code></a></td><td
class="printindex-index-section"><a href="#Top">Top</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-fun"><code>fun</code></a></td><td
class="printindex-index-section"><a href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Top_fn_letter-X">X</th></tr>
+<tr><th id="chapter_fn_letter-X">X</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-xf"><code>xf</code></a></td><td
class="printindex-index-section"><a href="#Top">Top</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-xftable-xitem"><code>xftable xitem</code></a></td><td
class="printindex-index-section"><a href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
-<table class="fn-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Top_fn_letter-C"><b>C</b></a>
+<table class="fn-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#chapter_fn_letter-C"><b>C</b></a>
-<a class="summary-letter-printindex" href="#Top_fn_letter-F"><b>F</b></a>
+<a class="summary-letter-printindex" href="#chapter_fn_letter-F"><b>F</b></a>
-<a class="summary-letter-printindex" href="#Top_fn_letter-X"><b>X</b></a>
+<a class="summary-letter-printindex" href="#chapter_fn_letter-X"><b>X</b></a>
</td></tr></table>
</div>
diff --git
a/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
b/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
index be4ef90c7c..aac6f6e238 100644
--- a/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
+++ b/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
@@ -775,7 +775,7 @@
$result_converted{'html_text'}->{'printindex_index_entry_in_copying_in_footnote'
<table class="cp-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th
class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
-<tr><th id="Top_cp_letter-C">C</th></tr>
+<tr><th id="chapter_cp_letter-C">C</th></tr>
<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying-Copying-this-document">Copying this document</a></td><td
class="printindex-index-section"><a href="#Top">Top</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>