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

    XMLWordPrintable

Details

    • xhtml parser, table cells, table header items, list items, embedded documents, block elements
    • Unit

    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

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

              Dates

                Created:
                Updated:
                Resolved: