Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-179

Nested lists incorrectly rendered in PDF

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 0.9.840
    • None
    • None

    Description

      Create an XWiki page with the following:

      * List Item 1
      ** Sublist Item 1
      ** Sublist Item 2
      * List Item 2
      

      Now, click the PDF link to generate a PDF version of the page. The list is incorrectly rendered – the first sublist item has an extra bullet. This appears to be due to the way XWiki processes bulleted lists. Here's a sample of the way XWiki renders the list above:

      <ul class="star">
      <li>List item 1</li>
      <li style="list-style: none">
      <ul class="star">
      <li>Sublist item 1</li>
      <li>Sublist item 2</li>
      </ul>
      </li>
      <li>List item 2</li>
      </ul>
      

      For some reason, XWiki wraps the sublist in a <li> whose list-style is set to none.

      I suggest the following modification to the xhtml2fo.xsl stylesheet:

      In the

        <xsl:template name="process-ul-li">
      

      There is an <xsl:choose> that selects the appropriate bullet marker. Modify as follows:

      <xsl:choose>
        <xsl:when test="@style = 'list-style: none'"/>  <!-- don't have a label for a list-style = none -->
        <xsl:when test="$depth = 1">
          ...
      

      I suggest the same for the process-ol-li template.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              sschaub Stephen Schaub
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: