Skip to content

Commit 74b5b9f

Browse files
author
Sanders Kleinfeld
committed
Handling of href-anchor to correspond to xrefgen.xsl
1 parent 4baffcf commit 74b5b9f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

htmlbook-xsl/chunk.xsl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
<!-- Chunk template used to split content among multiple .html files -->
1212

13-
<!-- ToDo: For XREF hyperlinks to ids that are in the same chunk, no need to prepend filename to anchor (although it probably doesn't hurt) -->
1413
<!-- ToDo: Add "previous" and "next" links as in the docbook-xsl stylesheets? -->
1514

1615
<!-- Imports htmlbook.xsl -->
@@ -323,18 +322,12 @@ sect5:s
323322
<!-- All XREFs must be tagged with a @data-type containing XREF -->
324323
<xsl:template match="h:a[contains(@data-type, 'xref')]">
325324
<xsl:param name="autogenerate-xrefs" select="$autogenerate-xrefs"/>
326-
<xsl:variable name="href-anchor">
327-
<xsl:choose>
328-
<!-- If href contains an # (as it should), we're going to assume the subsequent text is the referent id -->
329-
<xsl:when test="contains(@href, '#')">
330-
<xsl:value-of select="substring-after(@href, '#')"/>
331-
</xsl:when>
332-
<!-- Otherwise, we'll just assume the entire href is the referent id -->
333-
<xsl:otherwise>
334-
<xsl:value-of select="@href"/>
335-
</xsl:otherwise>
336-
</xsl:choose>
325+
<xsl:variable name="calculated-output-href">
326+
<xsl:call-template name="calculate-output-href">
327+
<xsl:with-param name="source-href-value" select="@href"/>
328+
</xsl:call-template>
337329
</xsl:variable>
330+
<xsl:variable name="href-anchor" select="substring-after($calculated-output-href, '#')"/>
338331
<xsl:variable name="is-xref">
339332
<xsl:call-template name="href-is-xref">
340333
<xsl:with-param name="href-value" select="@href"/>

0 commit comments

Comments
 (0)