]> granicus.if.org Git - docbook-dsssl/commitdiff
Add support for @width per bug report #2012736.
authorBob Stayton <bobs@sagehill.net>
Wed, 11 Mar 2009 21:32:15 +0000 (21:32 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 11 Mar 2009 21:32:15 +0000 (21:32 +0000)
xsl/html/verbatim.xsl

index 430f153d8de2681798aeaf984cfb3c368dfd7425..e0e059aa14efdf92eaee1f983cad4295d20b7158 100644 (file)
@@ -48,9 +48,9 @@
 
   <xsl:choose>
     <xsl:when test="$suppress-numbers = '0'
-                   and @linenumbering = 'numbered'
-                   and $use.extensions != '0'
-                   and $linenumbering.extension != '0'">
+                    and @linenumbering = 'numbered'
+                    and $use.extensions != '0'
+                    and $linenumbering.extension != '0'">
       <xsl:variable name="rtf">
         <xsl:choose>
           <xsl:when test="$highlight.source != 0">
       </xsl:variable>
       <pre>
         <xsl:apply-templates select="." mode="class.attribute"/>
-       <xsl:call-template name="number.rtf.lines">
-         <xsl:with-param name="rtf" select="$rtf"/>
-       </xsl:call-template>
+        <xsl:if test="@width != ''">
+          <xsl:attribute name="width">
+            <xsl:value-of select="@width"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:call-template name="number.rtf.lines">
+          <xsl:with-param name="rtf" select="$rtf"/>
+        </xsl:call-template>
       </pre>
     </xsl:when>
     <xsl:otherwise>
       <pre>
         <xsl:apply-templates select="." mode="class.attribute"/>
+        <xsl:if test="@width != ''">
+          <xsl:attribute name="width">
+            <xsl:value-of select="@width"/>
+          </xsl:attribute>
+        </xsl:if>
         <xsl:choose>
           <xsl:when test="$highlight.source != 0">
             <xsl:call-template name="apply-highlighting"/>
 
   <xsl:choose>
     <xsl:when test="$suppress-numbers = '0'
-                   and @linenumbering = 'numbered'
-                   and $use.extensions != '0'
-                   and $linenumbering.extension != '0'">
+                    and @linenumbering = 'numbered'
+                    and $use.extensions != '0'
+                    and $linenumbering.extension != '0'">
       <xsl:choose>
-       <xsl:when test="@class='monospaced'">
+        <xsl:when test="@class='monospaced'">
           <pre>
             <xsl:apply-templates select="." mode="class.attribute"/>
-           <xsl:call-template name="number.rtf.lines">
-             <xsl:with-param name="rtf" select="$rtf"/>
-           </xsl:call-template>
-         </pre>
-       </xsl:when>
-       <xsl:otherwise>
+            <xsl:call-template name="number.rtf.lines">
+              <xsl:with-param name="rtf" select="$rtf"/>
+            </xsl:call-template>
+          </pre>
+        </xsl:when>
+        <xsl:otherwise>
           <div>
             <xsl:apply-templates select="." mode="class.attribute"/>
-           <p>
-             <xsl:call-template name="number.rtf.lines">
-               <xsl:with-param name="rtf" select="$rtf"/>
-             </xsl:call-template>
-           </p>
-         </div>
-       </xsl:otherwise>
+            <p>
+              <xsl:call-template name="number.rtf.lines">
+                <xsl:with-param name="rtf" select="$rtf"/>
+              </xsl:call-template>
+            </p>
+          </div>
+        </xsl:otherwise>
       </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
       <xsl:choose>
-       <xsl:when test="@class='monospaced'">
+        <xsl:when test="@class='monospaced'">
           <pre>
             <xsl:apply-templates select="." mode="class.attribute"/>
-           <xsl:copy-of select="$rtf"/>
-         </pre>
-       </xsl:when>
-       <xsl:otherwise>
+            <xsl:copy-of select="$rtf"/>
+          </pre>
+        </xsl:when>
+        <xsl:otherwise>
           <div>
             <xsl:apply-templates select="." mode="class.attribute"/>
-           <p>
-             <xsl:call-template name="make-verbatim">
-               <xsl:with-param name="rtf" select="$rtf"/>
-             </xsl:call-template>
-           </p>
-         </div>
-       </xsl:otherwise>
+            <p>
+              <xsl:call-template name="make-verbatim">
+                <xsl:with-param name="rtf" select="$rtf"/>
+              </xsl:call-template>
+            </p>
+          </div>
+        </xsl:otherwise>
       </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>