Skip to content

Commit 59bfc91

Browse files
author
Sanders Kleinfeld
committed
href handling for a elems that are not XREFs
1 parent 982af20 commit 59bfc91

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

htmlbook-xsl/xrefgen.xsl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@
6161
</xsl:copy>
6262
</xsl:template>
6363

64+
<!-- href handling for a elements that are not indexterms, xrefs, or footnoterefs -->
65+
<xsl:template match="h:a[not((contains(@data-type, 'xref')) or
66+
(contains(@data-type, 'footnoteref')) or
67+
(contains(@data-type, 'indexterm')))][@href]">
68+
<xsl:copy>
69+
<xsl:apply-templates select="@*[not(name(.) = 'href')]"/>
70+
<xsl:attribute name="href">
71+
<xsl:call-template name="calculate-output-href">
72+
<xsl:with-param name="source-href-value" select="@href"/>
73+
</xsl:call-template>
74+
</xsl:attribute>
75+
<xsl:apply-templates/>
76+
</xsl:copy>
77+
</xsl:template>
78+
6479
<!-- Adapted from docbook-xsl templates in xhtml/xref.xsl -->
6580
<xsl:template match="*" mode="xref-to">
6681
<xsl:param name="referrer"/>

0 commit comments

Comments
 (0)