]> git.draconx.ca Git - homepage.git/blobdiff - layouts/default.xsl
Strip leading and trailing whitespace from all <p> tags.
[homepage.git] / layouts / default.xsl
index d7381d5dc5a3ace18fdaa400b2a45ebae917e844..020d1fdc61bd89728a910eb97587f052345eaf89 100644 (file)
   </xsl:choose>
 </xsl:template>
 
   </xsl:choose>
 </xsl:template>
 
+<!-- Clean up whitespace where harmless to do so -->
+<xsl:template match='xhtml:p/node()[1][self::text()]'>
+  <xsl:value-of select='f:strip-leading()' />
+</xsl:template>
+<xsl:template match='xhtml:p/node()[position()=last()][self::text()]'>
+  <xsl:value-of select='f:strip-trailing()' />
+</xsl:template>
+
 <!-- Add rel attributes to external links -->
 <xsl:template match='xhtml:a[starts-with(@href,"http://")
                           or starts-with(@href,"https://")
 <!-- Add rel attributes to external links -->
 <xsl:template match='xhtml:a[starts-with(@href,"http://")
                           or starts-with(@href,"https://")