(tomcat) branch 9.0.x updated: Fix nested subsection handling in documentation

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178664271056.1927803.2713422012278911757@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

ChristopherSchultz pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new e655375631 Fix nested subsection handling in documentation
e655375631 is described below

commit e6553756311f3b00db382923bbcb484772e47e80
Author: Fatima Qaisar <[email protected]>
AuthorDate: Wed Aug 12 14:09:31 2026 +0500

    Fix nested subsection handling in documentation
---
 webapps/docs/tomcat-docs.xsl | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/webapps/docs/tomcat-docs.xsl b/webapps/docs/tomcat-docs.xsl
index 8f3ef373e0..a6900736dc 100644
--- a/webapps/docs/tomcat-docs.xsl
+++ b/webapps/docs/tomcat-docs.xsl
@@ -231,11 +231,23 @@
 
     <div class="subsection">
       <!-- Subsection heading -->
-      <!-- TODO: When a <subsection> is nested in another <subsection>,
-           the output should be <h5>, not <h4>. Same with <h6>. -->
-      <h4 id="{$name}">
-        <xsl:value-of select="@name"/>
-      </h4>
+      <xsl:choose>
+        <xsl:when test="not(parent::subsection)">
+          <h4 id="{$name}">
+            <xsl:value-of select="@name"/>
+          </h4>
+        </xsl:when>
+        <xsl:when test="parent::subsection and not(parent::subsection/parent::subsection)">
+          <h5 id="{$name}">
+            <xsl:value-of select="@name"/>
+          </h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 id="{$name}">
+            <xsl:value-of select="@name"/>
+          </h6>
+        </xsl:otherwise>
+      </xsl:choose>
       <!-- Subsection body -->
       <div class="text">
         <xsl:apply-templates/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.