svn commit: r44133 - head/share/xml
Gabor Kovesdan
gabor at FreeBSD.org
Wed Mar 5 18:10:33 UTC 2014
Author: gabor
Date: Wed Mar 5 18:10:32 2014
New Revision: 44133
URL: http://svnweb.freebsd.org/changeset/doc/44133
Log:
- Rewrite text wrapping for HTML line numbering so that empty lines
are not lost
Reported by: wblock
Modified:
head/share/xml/freebsd-xhtml-common.xsl
Modified: head/share/xml/freebsd-xhtml-common.xsl
==============================================================================
--- head/share/xml/freebsd-xhtml-common.xsl Wed Mar 5 17:26:02 2014 (r44132)
+++ head/share/xml/freebsd-xhtml-common.xsl Wed Mar 5 18:10:32 2014 (r44133)
@@ -298,9 +298,27 @@
<xsl:template name="wrap.text">
<xsl:param name="content"/>
- <xsl:for-each select="str:tokenize($content, '
')">
- <span class="verbatim"><xsl:value-of select="."/>
</span>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="starts-with($content, '
')">
+ <span class="verbatim">​</span>
+
+ <xsl:call-template name="wrap.text">
+ <xsl:with-param name="content" select="substring-after($content, '
')"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($content, '
')">
+ <span class="verbatim"><xsl:value-of select="substring-before($content, '
')"/>
</span>
+
+ <xsl:call-template name="wrap.text">
+ <xsl:with-param name="content" select="substring-after($content, '
')"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <span class="verbatim"><xsl:value-of select="$content"/>
</span>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- XXX: breaks line numbering and syntax highlighting that we do not use
More information about the svn-doc-head
mailing list