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, '&#x0A;')">
-      <span class="verbatim"><xsl:value-of select="."/>&#x0A;</span>
-    </xsl:for-each>
+    <xsl:choose>
+      <xsl:when test="starts-with($content, '&#x0A;')">
+	<span class="verbatim">&#x200b;</span>
+
+	<xsl:call-template name="wrap.text">
+	  <xsl:with-param name="content" select="substring-after($content, '&#x0A;')"/>
+	</xsl:call-template>
+      </xsl:when>
+
+      <xsl:when test="contains($content, '&#x0A;')">
+	<span class="verbatim"><xsl:value-of select="substring-before($content, '&#x0A;')"/>&#x0A;</span>
+
+	<xsl:call-template name="wrap.text">
+	  <xsl:with-param name="content" select="substring-after($content, '&#x0A;')"/>
+	</xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+	<span class="verbatim"><xsl:value-of select="$content"/>&#x0A;</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-all mailing list