]> granicus.if.org Git - docbook-dsssl/commitdiff
Correctly handle lists that have block content before the actual
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 27 Aug 2006 16:10:27 +0000 (16:10 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 27 Aug 2006 16:10:27 +0000 (16:10 +0000)
list items. Closes bug #1547511. Thanks to Daniel Leidert. Also,
attempt to be smarter about adding space after lists where needed.

xsl/manpages/lists.xsl

index bf8011848a1ee5fa56146516487a67fa1eeff625..94e10ea9d98dd59709774a313697a736638b1342 100644 (file)
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
+  <!-- * DocBook allows just about any block content to appear in -->
+  <!-- * lists before the actual list items, so we need to get that -->
+  <!-- * content (if any) before getting the list items -->
+  <xsl:apply-templates
+      select="*[not(self::listitem) and not(self::title)]"/>
   <xsl:text>.TP</xsl:text> 
   <xsl:if test="not($list-indent = '')">
     <xsl:text> </xsl:text>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:if test="following-sibling::node()">
+  <xsl:apply-templates select="listitem"/>
+  <!-- * If this list is a child of para and has content following -->
+  <!-- * it, within the same para, then add a blank line and move -->
+  <!-- * the left margin back to where it was -->
+  <xsl:if test="parent::para and following-sibling::node()">
     <xsl:text>.sp&#10;</xsl:text>
     <xsl:text>.RE&#10;</xsl:text>
   </xsl:if>