Skip to content

Commit 2f026df

Browse files
author
Sanders Kleinfeld
committed
Fix to ensure no inlines in navPoint label text
1 parent 65dadc9 commit 2f026df

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

htmlbook-xsl/ncx.xsl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383

8484
<!-- Only put the Nav doc in the NCX TOC if $nav.in.ncx is enabled -->
8585
<xsl:template match="h:nav[@data-type='toc']" mode="ncx.toc.gen">
86+
<xsl:param name="nav.in.ncx" select="$nav.in.ncx"/>
8687
<xsl:if test="$nav.in.ncx = 1">
8788
<xsl:call-template name="generate.navpoint"/>
8889
</xsl:if>
@@ -106,6 +107,10 @@
106107

107108
<xsl:template name="generate.navpoint">
108109
<xsl:param name="node" select="."/>
110+
111+
<!-- Primarily included for xspec testing, but allows for the possibility of toggling labeling for individual navPoints -->
112+
<xsl:param name="ncx.toc.include.labels" select="$ncx.toc.include.labels"/>
113+
109114
<!-- Traverse down the tree and process descendant navpoints? Default is "yes" -->
110115
<xsl:param name="process-descendants" select="1"/>
111116
<navPoint>
@@ -124,7 +129,11 @@
124129
<xsl:value-of select="$label.and.title.separator"/>
125130
</xsl:if>
126131
</xsl:if>
127-
<xsl:apply-templates select="$node" mode="title.markup"/>
132+
<xsl:variable name="title.markup">
133+
<xsl:apply-templates select="$node" mode="title.markup"/>
134+
</xsl:variable>
135+
<!-- Convert to text, as NCX navLabels cannot contain any inline markup -->
136+
<xsl:value-of select="$title.markup"/>
128137
</text>
129138
</navLabel>
130139
<content>

0 commit comments

Comments
 (0)