aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2017-10-04 10:27:57 +0200
committerAdrian Kummerlaender2017-10-04 10:38:47 +0200
commit5d546c9a134ebd92dcef09bd620196c0d8d85aa1 (patch)
tree3326e7206876951860044e943c1243b88cd05d22
parente6bcce7cb1194783672be55442f1ec08f543af10 (diff)
downloadblog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar.gz
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar.bz2
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar.lz
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar.xz
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.tar.zst
blog.kummerlaender.eu-5d546c9a134ebd92dcef09bd620196c0d8d85aa1.zip
Fix footnote links, backlinks for all article outputs
See also ea80a43
-rw-r--r--source/99_result/stream.xsl20
-rw-r--r--utility/xhtml.xsl21
2 files changed, 21 insertions, 20 deletions
diff --git a/source/99_result/stream.xsl b/source/99_result/stream.xsl
index 284a4d0..c095088 100644
--- a/source/99_result/stream.xsl
+++ b/source/99_result/stream.xsl
@@ -52,26 +52,6 @@
</div>
</xsl:template>
-<xsl:template match="a" mode="xhtml">
- <xsl:choose>
- <xsl:when test="(@class = 'footnote') or (@class = 'reversefootnote')">
- <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
- <xsl:copy-of select="@class"/>
- <xsl:attribute name="href">
- <xsl:value-of select="concat('/article/', ancestor::entry/@handle, '/', @href)"/>
- </xsl:attribute>
- <xsl:apply-templates select="node()" mode="xhtml"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="node()" mode="xhtml"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
<xsl:template match="articles/entry" mode="resolve">
<h2>
<xsl:text>ยป </xsl:text>
diff --git a/utility/xhtml.xsl b/utility/xhtml.xsl
index 00f1ef2..c450175 100644
--- a/utility/xhtml.xsl
+++ b/utility/xhtml.xsl
@@ -25,4 +25,25 @@
<xsl:copy/>
</xsl:template>
+<xsl:template match="a[@class = 'footnoteRef']" mode="xhtml">
+ <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:copy-of select="@class"/>
+ <xsl:copy-of select="@id"/>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('/article/', ancestor::entry/@handle, '/', @href)"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="node()" mode="xhtml"/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="div[@class = 'footnotes']/ol/li/p/a[@class = 'more']" mode="xhtml">
+ <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:copy-of select="@class"/>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('/article/', ancestor::entry/@handle, '/', @href)"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="node()" mode="xhtml"/>
+ </xsl:element>
+</xsl:template>
+
</xsl:stylesheet>