Fixed bug #1321, also taking into account fixing bug #1281.
authorBob Stayton <bobs@sagehill.net>
Wed, 8 Jan 2014 18:36:48 +0000 (18:36 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 8 Jan 2014 18:36:48 +0000 (18:36 +0000)
xsl/manpages/utility.xsl

index b64d0e732d483fb9942c6805c98631f30d35c49d..e32d5c8306b2c9255d5c30deef613f52603d8881 100644 (file)
                     or following-sibling::node()[1][self::comment()]
                     or following-sibling::node()[1][self::processing-instruction()]
                     ">
-            <xsl:if test="normalize-space($content) != ''
-                          or concat(normalize-space($content), ' ') != ' '">
-              <xsl:text>&#10;</xsl:text>
-            </xsl:if>
+            <xsl:choose>
+              <xsl:when test="normalize-space($content) != ''">
+                <xsl:text>&#10;</xsl:text>
+              </xsl:when>
+              <!-- whitespace node adds line break space only if not first -->
+              <xsl:when test="concat(normalize-space($content), ' ') = ' '
+                              and preceding-sibling::node()">
+                <xsl:text>&#10;</xsl:text>
+              </xsl:when>
+            </xsl:choose>
           </xsl:if>
         </xsl:when>
         <xsl:otherwise>