]> granicus.if.org Git - docbook-dsssl/commitdiff
Problem::
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 5 Oct 2005 05:28:49 +0000 (05:28 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 5 Oct 2005 05:28:49 +0000 (05:28 +0000)
Extra space added before Arg output Cmdsynopsis in some cases
where the Arg contents appear at the beginning of a line.

  bdmond [-s, --start]
          [-k, --stop]
          [-h, --help]
          [-V, --version]

Cause::
Some other fix made around the time of v1.68.0 introduced a
regression in behavior for cases where an Arg is preceded by an
Sbr. The Sbr produces a line break as expected, but the line break
is followed by a space and then the contents of the following Arg.

Fix::
The code for processing Args now checks to see if the first
preceding sibling of the Arg is an Sbr. If so, it does not output
the additional space; otherwise, it outputs the space.

-  <xsl:if test="position()>1"><xsl:value-of select="$sepchar"/></xsl:if>
+  <xsl:if test="position()>1 and
+                not(preceding-sibling::*[1][self::sbr])"
+          ><xsl:value-of select="$sepchar"/></xsl:if>

Closes #1313481. Thanks to Costin Stroie for reporting the problem
and pointing out where the cause was in the code.

xsl/manpages/synop.xsl

index c48fa3e5bcca1028f94c1bb603557815094cff1b..af8943597f734417b4585aa4c5e93c5d28054ac1 100644 (file)
@@ -36,7 +36,9 @@
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
-  <xsl:if test="position()>1"><xsl:value-of select="$sepchar"/></xsl:if>
+  <xsl:if test="position()>1 and
+                not(preceding-sibling::*[1][self::sbr])"
+          ><xsl:value-of select="$sepchar"/></xsl:if>
   <xsl:choose>
     <xsl:when test="$choice='plain'">
       <!-- * do nothing -->