texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/HTML.pm (_get_target) (_set_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/HTML.pm (_get_target) (_set_heading_commands_targets, _prepare_conversion_units), tp/Texinfo/XS/convert/convert_html.c (html_get_target) (heading_commands_list, set_heading_commands_targets) (html_prepare_conversion_units_targets): prepare heading command targets in advance, not dynamically during the conversion.
Date: Tue, 26 Dec 2023 13:29:57 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 0282137a38 * tp/Texinfo/Convert/HTML.pm (_get_target) 
(_set_heading_commands_targets, _prepare_conversion_units), 
tp/Texinfo/XS/convert/convert_html.c (html_get_target) (heading_commands_list, 
set_heading_commands_targets) (html_prepare_conversion_units_targets): prepare 
heading command targets in advance, not dynamically during the conversion.
0282137a38 is described below

commit 0282137a383e37a4ede52b4d9b678d2c34b223c8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 26 19:29:50 2023 +0100

    * tp/Texinfo/Convert/HTML.pm (_get_target)
    (_set_heading_commands_targets, _prepare_conversion_units),
    tp/Texinfo/XS/convert/convert_html.c (html_get_target)
    (heading_commands_list, set_heading_commands_targets)
    (html_prepare_conversion_units_targets): prepare heading command
    targets in advance, not dynamically during the conversion.
---
 ChangeLog                                          |  9 +++++
 tp/Texinfo/Convert/HTML.pm                         | 35 +++++++++++-------
 tp/Texinfo/XS/convert/convert_html.c               | 41 +++++++++++++++-------
 .../res_parser/formatting_chm/chapter.html         | 10 +++---
 .../res_parser/formatting_chm/formatting.html      | 20 +++++------
 .../EPUB/xhtml/chapter.xhtml                       | 10 +++---
 .../EPUB/xhtml/formatting.xhtml                    | 20 +++++------
 .../res_parser/formatting_html32/formatting.html   | 30 ++++++++--------
 .../formatting_html_no_split/formatting.html       | 20 +++++------
 .../formatting_regions/formatting_regions.html     | 30 ++++++++--------
 .../res_parser/formatting_xhtml/formatting.html    | 30 ++++++++--------
 .../formatting_enable_encoding/formatting.html     | 30 ++++++++--------
 .../EPUB/xhtml/chapter.xhtml                       | 10 +++---
 .../EPUB/xhtml/formatting.xhtml                    | 20 +++++------
 .../res_parser/formatting_exotic/chapter.html      | 20 +++++------
 .../res_parser/formatting_fr/formatting.html       | 30 ++++++++--------
 .../res_parser/formatting_fr_icons/formatting.html | 30 ++++++++--------
 .../formatting_inline_css/formatting.html          | 30 ++++++++--------
 .../res_parser/formatting_mathjax/formatting.html  | 30 ++++++++--------
 .../formatting_numerical_entities/formatting.html  | 30 ++++++++--------
 .../formatting_sort_element_counts/formatting.html | 20 +++++------
 .../formatting_texi2html/formatting.html           | 30 ++++++++--------
 .../formatting_texi2html_nodes/chapter.html        | 10 +++---
 .../formatting_texi2html_nodes/index.html          | 20 +++++------
 .../formatting_weird_quotes/formatting.html        | 30 ++++++++--------
 .../res_parser/formatting_singular/chapter.html    | 20 +++++------
 26 files changed, 325 insertions(+), 290 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4027aec755..1745d33bcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-12-26  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/HTML.pm (_get_target)
+       (_set_heading_commands_targets, _prepare_conversion_units),
+       tp/Texinfo/XS/convert/convert_html.c (html_get_target)
+       (heading_commands_list, set_heading_commands_targets)
+       (html_prepare_conversion_units_targets): prepare heading command
+       targets in advance, not dynamically during the conversion.
+
 2023-12-26  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Converter.pm: document functions in converter for
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 42b78c1962..3ca4941a8a 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -881,24 +881,15 @@ sub _get_target($$)
 {
   my $self = shift;
   my $command = shift;
-  my $target;
   if (!defined($command)) {
     cluck("_get_target command not defined");
   }
 
-  if (!$self->{'targets'}->{$command}
-      and $command->{'cmdname'}
-    # This should only happen for @*heading*, root_commands targets should
-    # already be set.
-      and $sectioning_heading_commands{$command->{'cmdname'}}
-      and !$root_commands{$command->{'cmdname'}}) {
-    $self->_new_sectioning_command_target($command);
-  }
-
   if ($self->{'targets'}->{$command}) {
-    $target = $self->{'targets'}->{$command};
+    return $self->{'targets'}->{$command};
   }
-  return $target;
+
+  return undef;
 }
 
 # API for links and elements directions formatting
@@ -9463,6 +9454,22 @@ sub _set_root_commands_targets_node_files($)
   }
 }
 
+sub _set_heading_commands_targets($)
+{
+  my $self = shift;
+
+  if ($self->{'global_commands'}) {
+    foreach my $cmdname (keys(%sectioning_heading_commands)) {
+      if (!$root_commands{$cmdname}
+          and $self->{'global_commands'}->{$cmdname}) {
+        foreach my $command (@{$self->{'global_commands'}->{$cmdname}}) {
+          $self->_new_sectioning_command_target($command);
+        }
+      }
+    }
+  }
+}
+
 sub _html_get_tree_root_element($$;$);
 
 # If $FIND_CONTAINER is set, the element that holds the command output
@@ -9496,7 +9503,7 @@ sub _html_get_tree_root_element($$;$)
         if ($current->{'cmdname'} eq 'copying'
             and $self->{'global_commands'}
             and $self->{'global_commands'}->{'insertcopying'}) {
-          foreach my $insertcopying(@{$self->{'global_commands'}
+          foreach my $insertcopying (@{$self->{'global_commands'}
                                                         ->{'insertcopying'}}) {
             #print STDERR "INSERTCOPYING\n" if ($debug);
             my ($output_unit, $root_command)
@@ -9892,6 +9899,8 @@ sub _prepare_conversion_units($$$)
   $self->_prepare_index_entries_targets();
   $self->_prepare_footnotes_targets();
 
+  $self->_set_heading_commands_targets();
+
   return ($output_units, $special_units, $associated_special_units);
 }
 
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 41ecc05507..1b065d7c68 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -2859,19 +2859,7 @@ html_get_target (CONVERTER *self, const ELEMENT *element)
 {
   HTML_TARGET *result
    = find_element_target (&self->html_targets, element);
-  enum command_id data_cmd = element_builtin_data_cmd (element);
-  unsigned long flags = builtin_command_data[data_cmd].flags;
-
-  if (!result && data_cmd
-      && flags & CF_sectioning_heading
-      && !(flags & CF_root))
-    {
-      size_t target_number;
-      new_sectioning_command_target (self, element);
 
-      target_number = find_element_target_number (&self->html_targets, 
element);
-      result = &self->html_targets.list[target_number -1];
-    }
   return result;
 }
 
@@ -4660,6 +4648,33 @@ prepare_footnotes_targets (CONVERTER *self)
     }
 }
 
+static enum command_id heading_commands_list[] = {
+  CM_chapheading, CM_heading, CM_subheading, CM_subsubheading,
+  CM_majorheading, 0,
+};
+
+void
+set_heading_commands_targets (CONVERTER *self)
+{
+  int i;
+  for (i = 0; heading_commands_list[i]; i++)
+    {
+      enum command_id cmd = heading_commands_list[i];
+      const ELEMENT_LIST *global_command
+        = get_cmd_global_multi_command (self->document->global_commands, cmd);
+
+      if (global_command->number > 0)
+        {
+          int j;
+          for (j = 0; j < global_command->number; j++)
+            {
+              const ELEMENT *command = global_command->list[j];
+              new_sectioning_command_target (self, command);
+            }
+        }
+    }
+}
+
 /* for conversion units except for associated special units that require
    files for document units to be set */
 void
@@ -4683,6 +4698,8 @@ html_prepare_conversion_units_targets (CONVERTER *self,
 
   prepare_index_entries_targets (self);
   prepare_footnotes_targets (self);
+
+  set_heading_commands_targets (self);
 }
 
 /* Associate output units to the global targets, First, Last, Top, Index.
diff --git a/tp/tests/coverage/res_parser/formatting_chm/chapter.html 
b/tp/tests/coverage/res_parser/formatting_chm/chapter.html
index 3a52bc966a..e21cb495fd 100644
--- a/tp/tests/coverage/res_parser/formatting_chm/chapter.html
+++ b/tp/tests/coverage/res_parser/formatting_chm/chapter.html
@@ -1851,15 +1851,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/coverage/res_parser/formatting_chm/formatting.html 
b/tp/tests/coverage/res_parser/formatting_chm/formatting.html
index 272f073b89..3f080b7019 100644
--- a/tp/tests/coverage/res_parser/formatting_chm/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_chm/formatting.html
@@ -1834,15 +1834,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2940,15 +2940,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git 
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
 
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
index a35004fb84..96141c558d 100644
--- 
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
+++ 
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
@@ -1851,15 +1851,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1">majorheading</h2>
+<h2 class="majorheading" id="majorheading">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading-1">chapheading</h2>
+<h2 class="chapheading" id="chapheading">chapheading</h2>
 
-<h3 class="heading" id="heading-1">heading</h3>
+<h3 class="heading" id="heading">heading</h3>
 
-<h4 class="subheading" id="subheading-1">subheading</h4>
+<h4 class="subheading" id="subheading">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
diff --git 
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
 
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
index 6577e9e45d..975c23e145 100644
--- 
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
+++ 
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
@@ -1834,15 +1834,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading">majorheading</h2>
+<h2 class="majorheading" id="majorheading-1">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading">chapheading</h2>
+<h2 class="chapheading" id="chapheading-1">chapheading</h2>
 
-<h3 class="heading" id="heading">heading</h3>
+<h3 class="heading" id="heading-1">heading</h3>
 
-<h4 class="subheading" id="subheading">subheading</h4>
+<h4 class="subheading" id="subheading-1">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
@@ -2940,15 +2940,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1">majorheading</h2>
+<h2 class="majorheading" id="majorheading">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading-1">chapheading</h2>
+<h2 class="chapheading" id="chapheading">chapheading</h2>
 
-<h3 class="heading" id="heading-1">heading</h3>
+<h3 class="heading" id="heading">heading</h3>
 
-<h4 class="subheading" id="subheading-1">subheading</h4>
+<h4 class="subheading" id="subheading">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
diff --git a/tp/tests/coverage/res_parser/formatting_html32/formatting.html 
b/tp/tests/coverage/res_parser/formatting_html32/formatting.html
index 5d794377a5..244bf2b592 100644
--- a/tp/tests/coverage/res_parser/formatting_html32/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_html32/formatting.html
@@ -1787,15 +1787,15 @@ html ''
 
 
 
-<h2 id="majorheading">majorheading</h2>
+<h2 id="majorheading-1">majorheading</h2>
 
-<h2 id="chapheading">chapheading</h2>
+<h2 id="chapheading-1">chapheading</h2>
 
-<h3 id="heading">heading</h3>
+<h3 id="heading-1">heading</h3>
 
-<h4 id="subheading">subheading</h4>
+<h4 id="subheading-1">subheading</h4>
 
-<h4 id="subsubheading">subsubheading</h4>
+<h4 id="subsubheading-1">subsubheading</h4>
 
 
 <p><code>@acronym{--a,an accronym @comma{} @enddots{}}</code> -a (an accronym 
, <small>...</small>)
@@ -2867,15 +2867,15 @@ html ''
 
 
 
-<h2 id="majorheading-1">majorheading</h2>
+<h2 id="majorheading">majorheading</h2>
 
-<h2 id="chapheading-1">chapheading</h2>
+<h2 id="chapheading">chapheading</h2>
 
-<h3 id="heading-1">heading</h3>
+<h3 id="heading">heading</h3>
 
-<h4 id="subheading-1">subheading</h4>
+<h4 id="subheading">subheading</h4>
 
-<h4 id="subsubheading-1">subsubheading</h4>
+<h4 id="subsubheading">subsubheading</h4>
 
 
 <p><code>@acronym{--a,an accronym @comma{} @enddots{}}</code> -a (an accronym 
, <small>...</small>)
@@ -4015,15 +4015,15 @@ html ''
 
 
 
-<h2 id="majorheading-1">majorheading</h2>
+<h2 id="majorheading">majorheading</h2>
 
-<h2 id="chapheading-1">chapheading</h2>
+<h2 id="chapheading">chapheading</h2>
 
-<h3 id="heading-1">heading</h3>
+<h3 id="heading">heading</h3>
 
-<h4 id="subheading-1">subheading</h4>
+<h4 id="subheading">subheading</h4>
 
-<h4 id="subsubheading-1">subsubheading</h4>
+<h4 id="subsubheading">subsubheading</h4>
 
 
 <p><code>@acronym{--a,an accronym @comma{} @enddots{}}</code> -a (an accronym 
, <small>...</small>)
diff --git 
a/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html 
b/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
index 228e087c6c..5bb653c142 100644
--- a/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
@@ -3008,15 +3008,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-2"><span>majorheading<a 
class="copiable-link" href="#majorheading-2"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-2"><span>chapheading<a 
class="copiable-link" href="#chapheading-2"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading-2"><span>heading<a class="copiable-link" 
href="#heading-2"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-2"><span>subheading<a 
class="copiable-link" href="#subheading-2"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-2"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-2"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4246,19 +4246,19 @@ html ''
 
 
 
-</pre><strong class="majorheading" id="majorheading-2">majorheading</strong>
+</pre><strong class="majorheading" id="majorheading-3">majorheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="chapheading" id="chapheading-2">chapheading</strong>
+</pre><strong class="chapheading" id="chapheading-3">chapheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="heading" id="heading-2">heading</strong>
+</pre><strong class="heading" id="heading-3">heading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subheading" id="subheading-2">subheading</strong>
+</pre><strong class="subheading" id="subheading-3">subheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subsubheading" id="subsubheading-2">subsubheading</strong>
+</pre><strong class="subsubheading" id="subsubheading-3">subsubheading</strong>
 <pre class="example-preformatted">
 
 
diff --git 
a/tp/tests/coverage/res_parser/formatting_regions/formatting_regions.html 
b/tp/tests/coverage/res_parser/formatting_regions/formatting_regions.html
index e0f7e5cbcc..d3f5847dd2 100644
--- a/tp/tests/coverage/res_parser/formatting_regions/formatting_regions.html
+++ b/tp/tests/coverage/res_parser/formatting_regions/formatting_regions.html
@@ -1841,15 +1841,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2946,15 +2946,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -6463,15 +6463,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/coverage/res_parser/formatting_xhtml/formatting.html 
b/tp/tests/coverage/res_parser/formatting_xhtml/formatting.html
index 85da66f945..914c64a313 100644
--- a/tp/tests/coverage/res_parser/formatting_xhtml/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_xhtml/formatting.html
@@ -1847,15 +1847,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2953,15 +2953,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4123,15 +4123,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git 
a/tp/tests/layout/res_parser/formatting_enable_encoding/formatting.html 
b/tp/tests/layout/res_parser/formatting_enable_encoding/formatting.html
index 84bd3ad637..dca9f04954 100644
--- a/tp/tests/layout/res_parser/formatting_enable_encoding/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_enable_encoding/formatting.html
@@ -1853,15 +1853,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> ¶</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> ¶</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> ¶</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> ¶</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> ¶</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> ¶</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> ¶</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> ¶</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> ¶</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> ¶</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">–a</abbr> (an accronym , <small 
class="enddots">...</small>)
@@ -2959,15 +2959,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> ¶</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> ¶</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> ¶</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> ¶</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> ¶</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> ¶</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> ¶</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> ¶</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> ¶</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> ¶</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">–a</abbr> (an accronym , <small 
class="enddots">...</small>)
@@ -4139,15 +4139,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> ¶</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> ¶</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> ¶</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> ¶</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> ¶</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> ¶</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> ¶</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> ¶</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> ¶</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> ¶</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">–a</abbr> (an accronym , <small 
class="enddots">...</small>)
diff --git 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/chapter.xhtml
 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/chapter.xhtml
index c146ff9443..44204c08be 100644
--- 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/chapter.xhtml
+++ 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/chapter.xhtml
@@ -1852,15 +1852,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1">majorheading</h2>
+<h2 class="majorheading" id="majorheading">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading-1">chapheading</h2>
+<h2 class="chapheading" id="chapheading">chapheading</h2>
 
-<h3 class="heading" id="heading-1">heading</h3>
+<h3 class="heading" id="heading">heading</h3>
 
-<h4 class="subheading" id="subheading-1">subheading</h4>
+<h4 class="subheading" id="subheading">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
diff --git 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/formatting.xhtml
 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/formatting.xhtml
index 0bcc98ad02..48c18615d0 100644
--- 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/formatting.xhtml
+++ 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/formatting.xhtml
@@ -1836,15 +1836,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading">majorheading</h2>
+<h2 class="majorheading" id="majorheading-1">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading">chapheading</h2>
+<h2 class="chapheading" id="chapheading-1">chapheading</h2>
 
-<h3 class="heading" id="heading">heading</h3>
+<h3 class="heading" id="heading-1">heading</h3>
 
-<h4 class="subheading" id="subheading">subheading</h4>
+<h4 class="subheading" id="subheading-1">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
@@ -2942,15 +2942,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1">majorheading</h2>
+<h2 class="majorheading" id="majorheading">majorheading</h2>
 
-<h2 class="chapheading" id="chapheading-1">chapheading</h2>
+<h2 class="chapheading" id="chapheading">chapheading</h2>
 
-<h3 class="heading" id="heading-1">heading</h3>
+<h3 class="heading" id="heading">heading</h3>
 
-<h4 class="subheading" id="subheading-1">subheading</h4>
+<h4 class="subheading" id="subheading">subheading</h4>
 
-<h4 class="subsubheading" id="subsubheading-1">subsubheading</h4>
+<h4 class="subsubheading" id="subsubheading">subsubheading</h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_exotic/chapter.html 
b/tp/tests/layout/res_parser/formatting_exotic/chapter.html
index d31d4f1dc0..2f99d95518 100644
--- a/tp/tests/layout/res_parser/formatting_exotic/chapter.html
+++ b/tp/tests/layout/res_parser/formatting_exotic/chapter.html
@@ -2968,15 +2968,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-2"><span>majorheading<a 
class="copiable-link" href="#majorheading-2"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-2"><span>chapheading<a 
class="copiable-link" href="#chapheading-2"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading-2"><span>heading<a class="copiable-link" 
href="#heading-2"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-2"><span>subheading<a 
class="copiable-link" href="#subheading-2"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-2"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-2"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4202,19 +4202,19 @@ html ''
 
 
 
-</pre><strong class="majorheading" id="majorheading-2">majorheading</strong>
+</pre><strong class="majorheading" id="majorheading-3">majorheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="chapheading" id="chapheading-2">chapheading</strong>
+</pre><strong class="chapheading" id="chapheading-3">chapheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="heading" id="heading-2">heading</strong>
+</pre><strong class="heading" id="heading-3">heading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subheading" id="subheading-2">subheading</strong>
+</pre><strong class="subheading" id="subheading-3">subheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subsubheading" id="subsubheading-2">subsubheading</strong>
+</pre><strong class="subsubheading" id="subsubheading-3">subsubheading</strong>
 <pre class="example-preformatted">
 
 
diff --git a/tp/tests/layout/res_parser/formatting_fr/formatting.html 
b/tp/tests/layout/res_parser/formatting_fr/formatting.html
index 8dcbc8bcda..3e090a6d79 100644
--- a/tp/tests/layout/res_parser/formatting_fr/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_fr/formatting.html
@@ -1849,15 +1849,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
+<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2955,15 +2955,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4118,15 +4118,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html 
b/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
index b917d697b7..a8e5f4560f 100644
--- a/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
@@ -1849,15 +1849,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
+<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2955,15 +2955,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4118,15 +4118,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_inline_css/formatting.html 
b/tp/tests/layout/res_parser/formatting_inline_css/formatting.html
index 1223879ab9..d650fff82d 100644
--- a/tp/tests/layout/res_parser/formatting_inline_css/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_inline_css/formatting.html
@@ -1813,15 +1813,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2919,15 +2919,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4068,15 +4068,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
style="visibility: hidden; text-decoration: none; line-height: 0em" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" style="visibility: hidden; text-decoration: none; 
line-height: 0em" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_mathjax/formatting.html 
b/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
index 845966a484..028c9c9cb9 100644
--- a/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
@@ -1852,15 +1852,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2956,15 +2956,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4124,15 +4124,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git 
a/tp/tests/layout/res_parser/formatting_numerical_entities/formatting.html 
b/tp/tests/layout/res_parser/formatting_numerical_entities/formatting.html
index bcfac3b6dd..633195976d 100644
--- a/tp/tests/layout/res_parser/formatting_numerical_entities/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_numerical_entities/formatting.html
@@ -1853,15 +1853,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &#182;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &#182;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &#182;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &#182;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &#182;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &#182;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &#182;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &#182;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &#182;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &#182;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
@@ -2959,15 +2959,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &#182;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &#182;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &#182;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &#182;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &#182;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &#182;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &#182;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &#182;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &#182;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &#182;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
@@ -4139,15 +4139,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &#182;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &#182;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &#182;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &#182;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &#182;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &#182;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &#182;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &#182;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &#182;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &#182;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym &#44; ...">&#8211;a</abbr> (an 
accronym &#44; <small class="enddots">...</small>)
diff --git 
a/tp/tests/layout/res_parser/formatting_sort_element_counts/formatting.html 
b/tp/tests/layout/res_parser/formatting_sort_element_counts/formatting.html
index f4242d8082..206140c1b9 100644
--- a/tp/tests/layout/res_parser/formatting_sort_element_counts/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_sort_element_counts/formatting.html
@@ -3008,15 +3008,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-2"><span>majorheading<a 
class="copiable-link" href="#majorheading-2"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-2"><span>chapheading<a 
class="copiable-link" href="#chapheading-2"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading-2"><span>heading<a class="copiable-link" 
href="#heading-2"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-2"><span>subheading<a 
class="copiable-link" href="#subheading-2"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-2"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-2"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4246,19 +4246,19 @@ html ''
 
 
 
-</pre><strong class="majorheading" id="majorheading-2">majorheading</strong>
+</pre><strong class="majorheading" id="majorheading-3">majorheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="chapheading" id="chapheading-2">chapheading</strong>
+</pre><strong class="chapheading" id="chapheading-3">chapheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="heading" id="heading-2">heading</strong>
+</pre><strong class="heading" id="heading-3">heading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subheading" id="subheading-2">subheading</strong>
+</pre><strong class="subheading" id="subheading-3">subheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subsubheading" id="subsubheading-2">subsubheading</strong>
+</pre><strong class="subsubheading" id="subsubheading-3">subsubheading</strong>
 <pre class="example-preformatted">
 
 
diff --git a/tp/tests/layout/res_parser/formatting_texi2html/formatting.html 
b/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
index 819d011f56..5dd467b536 100644
--- a/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
@@ -1849,15 +1849,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
+<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2955,15 +2955,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4118,15 +4118,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_texi2html_nodes/chapter.html 
b/tp/tests/layout/res_parser/formatting_texi2html_nodes/chapter.html
index d405a9a9ab..880e9e30ba 100644
--- a/tp/tests/layout/res_parser/formatting_texi2html_nodes/chapter.html
+++ b/tp/tests/layout/res_parser/formatting_texi2html_nodes/chapter.html
@@ -1867,15 +1867,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html 
b/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
index dcabe41a87..b3297dbbc0 100644
--- a/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
+++ b/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
@@ -1835,15 +1835,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
+<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2941,15 +2941,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/layout/res_parser/formatting_weird_quotes/formatting.html 
b/tp/tests/layout/res_parser/formatting_weird_quotes/formatting.html
index 2bc03b98a3..39b2ddb534 100644
--- a/tp/tests/layout/res_parser/formatting_weird_quotes/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_weird_quotes/formatting.html
@@ -1853,15 +1853,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
+<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -2959,15 +2959,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4139,15 +4139,15 @@ html ''
 
 
 
-<h2 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h2>
+<h2 class="majorheading" id="majorheading"><span>majorheading<a 
class="copiable-link" href="#majorheading"> &para;</a></span></h2>
 
-<h2 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h2>
+<h2 class="chapheading" id="chapheading"><span>chapheading<a 
class="copiable-link" href="#chapheading"> &para;</a></span></h2>
 
-<h3 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h3>
+<h3 class="heading" id="heading"><span>heading<a class="copiable-link" 
href="#heading"> &para;</a></span></h3>
 
-<h4 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h4>
+<h4 class="subheading" id="subheading"><span>subheading<a 
class="copiable-link" href="#subheading"> &para;</a></span></h4>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading"><span>subsubheading<a 
class="copiable-link" href="#subsubheading"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
diff --git a/tp/tests/tex_html/res_parser/formatting_singular/chapter.html 
b/tp/tests/tex_html/res_parser/formatting_singular/chapter.html
index be70d96f86..aeae92b6e6 100644
--- a/tp/tests/tex_html/res_parser/formatting_singular/chapter.html
+++ b/tp/tests/tex_html/res_parser/formatting_singular/chapter.html
@@ -3225,15 +3225,15 @@ html ''
 
 
 
-<h1 class="majorheading" id="majorheading-1"><span>majorheading<a 
class="copiable-link" href="#majorheading-1"> &para;</a></span></h1>
+<h1 class="majorheading" id="majorheading-2"><span>majorheading<a 
class="copiable-link" href="#majorheading-2"> &para;</a></span></h1>
 
-<h1 class="chapheading" id="chapheading-1"><span>chapheading<a 
class="copiable-link" href="#chapheading-1"> &para;</a></span></h1>
+<h1 class="chapheading" id="chapheading-2"><span>chapheading<a 
class="copiable-link" href="#chapheading-2"> &para;</a></span></h1>
 
-<h2 class="heading" id="heading-1"><span>heading<a class="copiable-link" 
href="#heading-1"> &para;</a></span></h2>
+<h2 class="heading" id="heading-2"><span>heading<a class="copiable-link" 
href="#heading-2"> &para;</a></span></h2>
 
-<h3 class="subheading" id="subheading-1"><span>subheading<a 
class="copiable-link" href="#subheading-1"> &para;</a></span></h3>
+<h3 class="subheading" id="subheading-2"><span>subheading<a 
class="copiable-link" href="#subheading-2"> &para;</a></span></h3>
 
-<h4 class="subsubheading" id="subsubheading-1"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-1"> &para;</a></span></h4>
+<h4 class="subsubheading" id="subsubheading-2"><span>subsubheading<a 
class="copiable-link" href="#subsubheading-2"> &para;</a></span></h4>
 
 
 <p><code class="code">@acronym{--a,an accronym @comma{} @enddots{}}</code> 
<abbr class="acronym" title="an accronym , ...">&ndash;a</abbr> (an accronym , 
<small class="enddots">...</small>)
@@ -4598,19 +4598,19 @@ html ''
 
 
 
-</pre><strong class="majorheading" id="majorheading-2">majorheading</strong>
+</pre><strong class="majorheading" id="majorheading-3">majorheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="chapheading" id="chapheading-2">chapheading</strong>
+</pre><strong class="chapheading" id="chapheading-3">chapheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="heading" id="heading-2">heading</strong>
+</pre><strong class="heading" id="heading-3">heading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subheading" id="subheading-2">subheading</strong>
+</pre><strong class="subheading" id="subheading-3">subheading</strong>
 <pre class="example-preformatted">
 
-</pre><strong class="subsubheading" id="subsubheading-2">subsubheading</strong>
+</pre><strong class="subsubheading" id="subsubheading-3">subsubheading</strong>
 <pre class="example-preformatted">
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]