[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    [PATCH 9/9] docs: newapi: Fix generation of type definition tables
From:       Peter Krempa <pkrempa () redhat ! com>
Date:       2024-02-29 14:58:23
Message-ID: bd6bafaad62ed2cc4f3034dd6c8d9afe8ef849f9.1709218314.git.pkrempa () redhat ! com
[Download RAW message or body]

Ensure that all rows have 3 columns and avoid generation of emtpy
elements which would be turned by the XML formatter into non-pair td/tr
tags which don't work properly with HTML5 parsers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/newapi.xsl | 45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index 51f159a2f8..aff4cf0d4e 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -384,7 +384,7 @@
           <xsl:for-each select="field">
             <xsl:choose>
               <xsl:when test='@type = "union"'>
-                <tr><td><span class="keyword">union</span> {</td></tr>
+                <tr><td colspan="3"><span class="keyword">union</span> {</td></tr>
                 <tr>
                   <td><table>
                     <xsl:for-each select="union/field">
@@ -397,31 +397,35 @@
                           </span>
                         </td>
                         <td><xsl:value-of select="@name"/></td>
-                        <xsl:if test="@info != ''">
-                          <td>
+                        <td>
+                          <xsl:if test="@info != ''">
                             <div class="comment">
                               <xsl:call-template name="dumptext">
                                 <xsl:with-param name="text" select="@info"/>
                               </xsl:call-template>
                             </div>
-                          </td>
-                        </xsl:if>
+                          </xsl:if>
+                          <xsl:comment> </xsl:comment>
+                        </td>
                       </tr>
                     </xsl:for-each>
                   </table></td>
-                <td></td></tr>
-                <tr><td>}</td>
-                <td><xsl:value-of select="@name"/></td>
-                <xsl:if test="@info != ''">
+                  <td colspan="2"><xsl:comment> </xsl:comment></td>
+                </tr>
+                <tr>
+                  <td>}</td>
+                  <td><xsl:value-of select="@name"/></td>
                   <td>
-                    <div class="comment">
-                      <xsl:call-template name="dumptext">
-                        <xsl:with-param name="text" select="@info"/>
-                      </xsl:call-template>
-                    </div>
+                    <xsl:if test="@info != ''">
+                      <div class="comment">
+                        <xsl:call-template name="dumptext">
+                          <xsl:with-param name="text" select="@info"/>
+                        </xsl:call-template>
+                      </div>
+                    </xsl:if>
+                    <xsl:comment> </xsl:comment>
                   </td>
-                </xsl:if>
-                <td></td></tr>
+                </tr>
               </xsl:when>
               <xsl:otherwise>
                 <tr>
@@ -433,15 +437,16 @@
                     </span>
                   </td>
                   <td><xsl:value-of select="@name"/></td>
-                  <xsl:if test="@info != ''">
-                    <td>
+                  <td>
+                    <xsl:if test="@info != ''">
                       <div class="comment">
                         <xsl:call-template name="dumptext">
                         <xsl:with-param name="text" select="@info"/>
                         </xsl:call-template>
                       </div>
-                    </td>
-                  </xsl:if>
+                    </xsl:if>
+                    <xsl:comment> </xsl:comment>
+                  </td>
                 </tr>
               </xsl:otherwise>
             </xsl:choose>
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic