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

XHTML parser does not generate embedded documents when there are block elements inside table cells, table header items or list items

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8 RC1
    • Fix Version/s: 1.8.1, 1.9 M1
    • Component/s: {Unused} Rendering 2.0
    • Labels:
      None
    • keywords:
      xhtml parser, table cells, table header items, list items, embedded documents, block elements
    • Tests:
      Unit
    • Similar issues:

      Description

      Following (failing) test case illustrates the issue for table cells and table header items:

      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <table><thead><tr><th><p>Head</p></th></tr></thead><tbody><tr><td><p>Cell</p></td></tr></tbody></table>
      .#-----------------------------------------------------
      .expect|xhtml/1.0
      .#-----------------------------------------------------
      <table><thead><tr><th><div class="xwiki-document"><p>Head</p></div></th></tr></thead><tbody><tr><td><div class="xwiki-document"><p>Cell</p></div></td></tr></tbody></table>
      

      And for list items:

      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <ol><li><p>Item1</p></li></ol>
      .#-----------------------------------------------------
      .expect|xhtml/1.0
      .#-----------------------------------------------------
      <ol><li><div class="xwiki-document"><p>Item1</p></div></li></ol>
      

      What is more surprising is the actual xhtml output from the xhtml renderer for above test cases. Following are the passing test cases:

      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <table><thead><tr><th><p>Head</p></th></tr></thead><tbody><tr><td><p>Cell</p></td></tr></tbody></table>
      .#-----------------------------------------------------
      .expect|xhtml/1.0
      .#-----------------------------------------------------
      <table><tr><th></th></tr></table><p>Head</p><table><tr><td></td></tr></table><p>Cell</p>
      

      And:

      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <ol><li><p>Item1</p></li></ol>
      .#-----------------------------------------------------
      .expect|xhtml/1.0
      .#-----------------------------------------------------
      <ol><li></li></ol><p>Item1</p>
      

      As you can see, the xhtml output from the xhtml renderer doesn't make any sense.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                asiri Asiri Rathnayake
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: