write every link as absolute within content:encoded

svn path=/trunk/; revision=19798
This commit is contained in:
nicoulas 2011-02-18 16:05:48 +00:00
parent bbcffa7690
commit 328c0e994f
1 changed files with 18 additions and 1 deletions

View File

@ -143,7 +143,7 @@
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
<xsl:choose>
<xsl:when test="body-complete">
<xsl:copy-of select="body-complete/node()"/>
<xsl:apply-templates select="body-complete/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="normalize-space(body)"/>
@ -195,6 +195,23 @@
</rss>
</xsl:template>
<!-- take care that links within <content:encoded> are not relative -->
<xsl:template match="a">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="substring(@href,1,1) = '/'">
<xsl:text>http//fsfe.org</xsl:text>
<xsl:value-of select="@href" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@href" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Do not copy <body-complete> to output at all -->
<xsl:template match="body-complete"/>