summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2009-05-02 21:47:23 -0500
committerShaun McCance <shaunm@gnome.org>2009-05-02 21:47:23 -0500
commit7efe93c679ec6a0c86ea255e21571478b6126270 (patch)
tree39e4d22830c56ea977321f4cd42d9a4967b642e4 /xslt
parent3e51d08b7294093f710e384db89ffc19a404e5e9 (diff)
downloadgnome-doc-utils-7efe93c679ec6a0c86ea255e21571478b6126270.tar.gz
[mallard] Fixed automatic link text for internal links
Diffstat (limited to 'xslt')
-rw-r--r--xslt/mallard/common/mal-link.xsl17
1 files changed, 16 insertions, 1 deletions
diff --git a/xslt/mallard/common/mal-link.xsl b/xslt/mallard/common/mal-link.xsl
index 850ef2f..de5817d 100644
--- a/xslt/mallard/common/mal-link.xsl
+++ b/xslt/mallard/common/mal-link.xsl
@@ -62,9 +62,24 @@ $href: The #{href} attribute of ${link}
</xsl:choose>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="fullid">
+ <xsl:choose>
+ <xsl:when test="contains($xref, '#')">
+ <xsl:variable name="pageid" select="substring-before($xref, '#')"/>
+ <xsl:variable name="sectionid" select="substring-after($xref, '#')"/>
+ <xsl:if test="$pageid = ''">
+ <xsl:value-of select="$link/ancestor::mal:page/@id"/>
+ </xsl:if>
+ <xsl:value-of select="concat($pageid, '#', $sectionid)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$xref"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:for-each select="$mal.cache">
<xsl:apply-templates mode="mal.link.content.mode"
- select="key('mal.cache.key', $xref)
+ select="key('mal.cache.key', $fullid)
/mal:info/mal:title[@type = 'link']/node()"/>
</xsl:for-each>
</xsl:otherwise>