|
|
@@ -929,7 +929,24 @@ h6 { |
|
|
|
--> |
|
|
|
<xsl:template name="br-replace"> |
|
|
|
<xsl:param name="word"/> |
|
|
|
<xsl:param name="splitlimit">32</xsl:param> |
|
|
|
<xsl:variable name="secondhalflen" select="(string-length($word)+(string-length($word) mod 2)) div 2"/> |
|
|
|
<xsl:variable name="secondhalfword" select="substring($word, $secondhalflen)"/> |
|
|
|
<!-- When word is very big, a recursive replace is very heap/stack expensive, so subdivide on line break after middle of string --> |
|
|
|
<xsl:choose> |
|
|
|
<xsl:when test="(string-length($word) > $splitlimit) and (contains($secondhalfword, '
'))"> |
|
|
|
<xsl:variable name="secondhalfend" select="substring-after($secondhalfword, '
')"/> |
|
|
|
<xsl:variable name="firsthalflen" select="string-length($word) - $secondhalflen"/> |
|
|
|
<xsl:variable name="firsthalfword" select="substring($word, 1, $firsthalflen)"/> |
|
|
|
<xsl:variable name="firsthalfend" select="substring-before($secondhalfword, '
')"/> |
|
|
|
<xsl:call-template name="br-replace"> |
|
|
|
<xsl:with-param name="word" select="concat($firsthalfword,$firsthalfend)"/> |
|
|
|
</xsl:call-template> |
|
|
|
<br/> |
|
|
|
<xsl:call-template name="br-replace"> |
|
|
|
<xsl:with-param name="word" select="$secondhalfend"/> |
|
|
|
</xsl:call-template> |
|
|
|
</xsl:when> |
|
|
|
<xsl:when test="contains($word, '
')"> |
|
|
|
<xsl:value-of select="substring-before($word, '
')"/> |
|
|
|
<br/> |
|
|
@@ -938,7 +955,7 @@ h6 { |
|
|
|
</xsl:call-template> |
|
|
|
</xsl:when> |
|
|
|
<xsl:otherwise> |
|
|
|
<xsl:value-of select="$word"/> |
|
|
|
<xsl:value-of select="$word"/> |
|
|
|
</xsl:otherwise> |
|
|
|
</xsl:choose> |
|
|
|
</xsl:template> |
|
|
|