Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-51834

Confluence will wrap-up <table> element with <div> element.

    XMLWordPrintable

Details

    Description

      Summary

      Creating table element on Confluence page and then trying to get value field from REST API from the same page will result in additional div element around the table. And classes for table and td beeing changed.

      Because of this behavior (additional div around the table and changing classes), multiple updates of the page trough REST API, with the same content, will cause an additional version of the page with no difference. If you would fire the PUT (update of the page) 10 times you would get 10 versions of the page. For comparison, if you update a page without the table in the body (value will stay same), the version will stay same, no matter how many PUT calls you make.

      Environment

      • Java 1.8.0_111
      • H2 database
      • Centos 7

      Steps to Reproduce

      1. Create simple table element on page XXXX in source editor like this or by creating it with POST REST API:
        <table class="wrapped">
        <colgroup> <col/> </colgroup>
        <tbody>
        <tr>
        <td>123</td>
        </tr>
        </tbody>
        </table>
        
      1. When you try to get the content of value attribute from the page by reaching it trough REST API and URL like this "GET http://confluence:8090/rest/api/content/XXXX?expand=body.view" you will get additional HTML element around the actual table in response value and additional classes on table and TD elements:
        <div class="table-wrap">
        <table class="confluenceTable">
        <colgroup> <col/> </colgroup>
        <tbody>
        <tr>
        <td class="confluenceTd">123</td>
        </tr>
        </tbody>
        </table>
        </div>
         

      Expected Results

      Trying to get value field trough REST API, you will get this response:

      <table class="wrapped">
      <colgroup> <col/> </colgroup>
      <tbody>
      <tr>
      <td>123</td>
      </tr>
      </tbody>
      </table>
      

      Note

      Updating the content of the page (without the table and lorem ipsum text) in UI with the same content will cause a new version of the page if you repeat that process with REST API version will not change and they should be same. 

      Workaround

      No known workaround at the moment.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gpaunovic g
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: