+<!--
+ Attempt to wrap the first bit of linked email addresses to allow
+ linewrapping to occur after the '@'.
+-->
+<xsl:template match='xhtml:a[starts-with(@href,"mailto:")]/text()'>
+ <xsl:variable name='addr' select='substring-after(../@href, "mailto:")' />
+
+ <xsl:variable name='wrap'
+ select='concat(substring-before($addr, "@"), "@")' />
+
+ <xsl:choose>
+ <xsl:when test='contains(., $wrap)'>
+ <xsl:value-of select='substring-before(., $wrap)' />
+ <span class='wbr'>
+ <xsl:value-of select='$wrap' />
+ </span>
+ <xsl:value-of select='substring-after(., $wrap)' />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy />
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+