Skip to content

Commit

Permalink
Expand titles
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Dec 18, 2024
1 parent 3a68b8c commit 813d7f7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Customization/xsl/scrollspy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
/>

<xsl:template
match="*[@id and (contains(@class, ' topic/section ') or contains(@class, ' topic/example '))]"
match="*[@id and ./*[contains(@class, ' topic/title ')] and (contains(@class, ' topic/section ') or contains(@class, ' topic/example '))]"
mode="scrollspy"
>
<xsl:choose>
Expand All @@ -144,7 +144,7 @@
<xsl:text>#</xsl:text>
<xsl:sequence select="dita-ot:generate-id(parent::*/parent::*/@id, @id)"/>
</xsl:attribute>
<xsl:value-of select="*[contains(@class, ' topic/title ')]"/>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]" mode="scrollspy-section-title"/>
</a>
</xsl:when>
<xsl:when test="$BOOTSTRAP_SCROLLSPY_TOC = ('nav-pill')">
Expand All @@ -153,7 +153,7 @@
<xsl:text>#</xsl:text>
<xsl:sequence select="dita-ot:generate-id(parent::*/parent::*/@id, @id)"/>
</xsl:attribute>
<xsl:value-of select="*[contains(@class, ' topic/title ')]"/>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]" mode="scrollspy-section-title"/>
</a>
</xsl:when>
<xsl:otherwise>
Expand All @@ -163,14 +163,16 @@
<xsl:text>#</xsl:text>
<xsl:sequence select="dita-ot:generate-id(parent::*/parent::*/@id, @id)"/>
</xsl:attribute>
<xsl:value-of select="*[contains(@class, ' topic/title ')]"/>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]" mode="scrollspy-section-title"/>
</a>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="*[contains(@class, ' topic/title ')]" mode="scrollspy-section-title">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="*" mode="scrollspy"/>
</xsl:stylesheet>

0 comments on commit 813d7f7

Please sign in to comment.