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

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

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


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

commit 9145e524376e501f543610ea94da8273265dc9e9
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 c5325d51f2..69d192e920 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.