]> granicus.if.org Git - docbook-dsssl/commitdiff
FR #422097, make a listitem containing a single simpara output an li with only inline...
authorNorman Walsh <ndw@nwalsh.com>
Thu, 5 Jul 2001 12:20:11 +0000 (12:20 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 5 Jul 2001 12:20:11 +0000 (12:20 +0000)
xsl/html/block.xsl
xsl/html/lists.xsl

index 9b171eec8084df5302458b624300c3b043a4b01f..7cf5b7b04e19901c351272f3ae646cc60913e3ec 100644 (file)
@@ -47,6 +47,7 @@
 </xsl:template>
 
 <xsl:template match="simpara">
+  <!-- see also listitem/simpara in lists.xsl -->
   <p>
     <xsl:if test="@id">
       <a name="{@id}"/>
index f35cc7a58a0670e81cfd737182ee3fad36265c71..8d840758cce058fcd8f4564751033cc74a313c1f 100644 (file)
   <xsl:number format="1"/>
 </xsl:template>
 
+<xsl:template match="listitem/simpara" priority="2">
+  <!-- If a listitem contains only a single simpara, don't output
+       the <p> wrapper; this has the effect of creating an li
+       with simple text content. -->
+  <xsl:choose>
+    <xsl:when test="not(preceding-sibling::*)
+                    and not (following-sibling::*)">
+      <xsl:if test="@id">
+        <a name="{@id}"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>
+        <xsl:if test="@id">
+          <a name="{@id}"/>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </p>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="varlistentry">
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>