(tomcat) branch main updated: Fix nested subsection handling in documentation

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 21e66557fe Fix nested subsection handling in documentation
21e66557fe is described below

commit 21e66557fe8c4564dcf7799859258565b60fce5a
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 211cdecffb..aec6a0d291 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.