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 (_convert_menu_entry


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type), tp/Texinfo/XS/convert/format_html.c (html_convert_menu_entry_type): if !NODE_NAME_IN_MENU, pick the associated section even if the node is the element command. Report from Frederico Muñoz.
Date: Mon, 23 Dec 2024 16:16:50 -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 783c184b52 * tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type), 
tp/Texinfo/XS/convert/format_html.c (html_convert_menu_entry_type): if 
!NODE_NAME_IN_MENU, pick the associated section even if the node is the element 
command.  Report from Frederico Muñoz.
783c184b52 is described below

commit 783c184b52c9ed53ef0bed4ea4eaa40e27e09f03
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Dec 23 22:16:18 2024 +0100

    * tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type),
    tp/Texinfo/XS/convert/format_html.c (html_convert_menu_entry_type):
    if !NODE_NAME_IN_MENU, pick the associated section even if the node is
    the element command.  Report from Frederico Muñoz.
---
 ChangeLog                                                   |  7 +++++++
 tp/Texinfo/Convert/HTML.pm                                  |  6 ++----
 tp/Texinfo/XS/convert/format_html.c                         | 13 +++----------
 .../res_html/index.html                                     |  2 +-
 .../nodes_after_top_before_section_texi2html_use_nodes.html |  2 +-
 .../res_html/index.html                                     |  2 +-
 6 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f538946c0..51f06edfa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/HTML.pm (_convert_menu_entry_type),
+       tp/Texinfo/XS/convert/format_html.c (html_convert_menu_entry_type):
+       if !NODE_NAME_IN_MENU, pick the associated section even if the node is
+       the element command.  Report from Frederico Muñoz.
+
 2024-12-23  Gavin Smith <gavinsmith0123@gmail.com>
 
        * system.h (setmode): Remove now unused.
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 131ad5c6e6..d5516a57df 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -7318,12 +7318,10 @@ sub _convert_menu_entry_type($$$)
            and defined($menu_entry_node->{'extra'}->{'normalized'})) {
     my $node = 
$self->label_command($menu_entry_node->{'extra'}->{'normalized'});
     if ($node) {
-      # if !NODE_NAME_IN_MENU, we pick the associated section, except if
-      # the node is the element command
+      # if !NODE_NAME_IN_MENU, we pick the associated section
       if ($node->{'extra'}
           and $node->{'extra'}->{'associated_section'}
-          and !$self->get_conf('NODE_NAME_IN_MENU')
-          and !($self->command_root_element_command($node) eq $node)) {
+          and !$self->get_conf('NODE_NAME_IN_MENU')) {
         $section = $node->{'extra'}->{'associated_section'};
         $href = $self->command_href($section, undef, $element);
       } else {
diff --git a/tp/Texinfo/XS/convert/format_html.c 
b/tp/Texinfo/XS/convert/format_html.c
index e09dfcdd24..dcad26bab5 100644
--- a/tp/Texinfo/XS/convert/format_html.c
+++ b/tp/Texinfo/XS/convert/format_html.c
@@ -11521,22 +11521,15 @@ html_convert_menu_entry_type (CONVERTER *self, const 
enum element_type type,
               node_description
                  = lookup_extra_element (node, AI_key_node_description);
 
-   /* if !NODE_NAME_IN_MENU, we pick the associated section, except if
-      the node is the element command */
+                /* if !NODE_NAME_IN_MENU, we pick the associated section */
               if (self->conf->NODE_NAME_IN_MENU.o.integer <= 0)
                 {
                   const ELEMENT *associated_section = lookup_extra_element 
(node,
                                                        
AI_key_associated_section);
                   if (associated_section)
                     {
-                      const ELEMENT *associated_command
-                       = html_command_root_element_command (self, node);
-                      if (associated_command != node)
-                        {
-                          section = associated_section;
-                          href = html_command_href (self, section,
-                                                    0, element, 0);
-                        }
+                      section = associated_section;
+                      href = html_command_href (self, section, 0, element, 0);
                     }
                 }
               if (!href)
diff --git 
a/tp/t/results/sectioning/nodes_after_top_before_chapter_texi2html_use_nodes_chapter/res_html/index.html
 
b/tp/t/results/sectioning/nodes_after_top_before_chapter_texi2html_use_nodes_chapter/res_html/index.html
index 25e18bf4f6..d810a8020d 100644
--- 
a/tp/t/results/sectioning/nodes_after_top_before_chapter_texi2html_use_nodes_chapter/res_html/index.html
+++ 
b/tp/t/results/sectioning/nodes_after_top_before_chapter_texi2html_use_nodes_chapter/res_html/index.html
@@ -38,7 +38,7 @@ td.menu-entry-destination {vertical-align: top}
 </p><table class="menu">
 <tr><td class="menu-entry-destination">&bull; <a href="#second-node">second 
node</a></td><td class="menu-entry-description">
 </td></tr>
-<tr><td class="menu-entry-destination">&bull; <a href="third-node.html">third 
node</a></td><td class="menu-entry-description">
+<tr><td class="menu-entry-destination"><a href="third-node.html">1 
chapter</a></td><td class="menu-entry-description">
 </td></tr>
 </table>
 
diff --git 
a/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes/res_html/nodes_after_top_before_section_texi2html_use_nodes.html
 
b/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes/res_html/nodes_after_top_before_section_texi2html_use_nodes.html
index 3534c6aa93..c5041cbe33 100644
--- 
a/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes/res_html/nodes_after_top_before_section_texi2html_use_nodes.html
+++ 
b/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes/res_html/nodes_after_top_before_section_texi2html_use_nodes.html
@@ -47,7 +47,7 @@ th.name-direction-about {border-width: thin; 
border-bottom-style: solid; border-
 </p><table class="menu">
 <tr><td class="menu-entry-destination">&bull; <a href="#chap-node">chap 
node</a></td><td class="menu-entry-description">
 </td></tr>
-<tr><td class="menu-entry-destination">&bull; <a href="#third-node">third 
node</a></td><td class="menu-entry-description">
+<tr><td class="menu-entry-destination"><a href="#third-node">1 
subsection</a></td><td class="menu-entry-description">
 </td></tr>
 </table>
 
diff --git 
a/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes_chapter/res_html/index.html
 
b/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes_chapter/res_html/index.html
index b00dee2165..d0578bc5c1 100644
--- 
a/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes_chapter/res_html/index.html
+++ 
b/tp/t/results/sectioning/nodes_after_top_before_section_texi2html_use_nodes_chapter/res_html/index.html
@@ -38,7 +38,7 @@ td.menu-entry-destination {vertical-align: top}
 </p><table class="menu">
 <tr><td class="menu-entry-destination">&bull; <a href="#chap-node">chap 
node</a></td><td class="menu-entry-description">
 </td></tr>
-<tr><td class="menu-entry-destination">&bull; <a href="#third-node">third 
node</a></td><td class="menu-entry-description">
+<tr><td class="menu-entry-destination"><a href="#third-node">1 
subsection</a></td><td class="menu-entry-description">
 </td></tr>
 </table>
 



reply via email to

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