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

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

      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.

            [CONFSERVER-51834] Confluence will wrap-up <table> element with <div> element.

            Still present in 8.5.22

            Derek Sharpe added a comment - Still present in 8.5.22

            Pavel Fila added a comment - - edited

            @mappleton I'm still experiencing this in 7.13.0 . 

            when  PUT via REST API contains

            <table>...</table>

            immediately followed by GET, the result is

            <div class="table-wrap"><table>...<table></div>

            which means that e.g. automated edits have to remove the wrapper div otherwise the content will just have more and more wrapper divs

            Pavel Fila added a comment - - edited @mappleton I'm still experiencing this in 7.13.0 .  when  PUT via REST API contains <table>...</table> immediately followed by GET, the result is <div class= "table-wrap" ><table>...<table></div> which means that e.g. automated edits have to remove the wrapper div otherwise the content will just have more and more wrapper divs

            Atlassian Update - September 2019

            Thank you for your interest in this ticket. The Confluence Server and Data Center team released a major upgrade to the editor in 6.14. Due to the age of this ticket and/or lack of updates, we suspect that this issue is no longer relevant or was resolved as a result of the upgrade and are now closing this ticket.

            If this issue is still a problem in your Confluence instance in version 6.15 or later, please tag me in your comment and we can reopen this ticket for review.

            You can read more about the editor upgrade in the 6.14 Release Notes.

            Thanks

            Makisa Appleton | Senior Product Manager, Confluence Server and Data Center

            Makisa Appleton added a comment - Atlassian Update - September 2019 Thank you for your interest in this ticket. The Confluence Server and Data Center team released a major upgrade to the editor in 6.14. Due to the age of this ticket and/or lack of updates, we suspect that this issue is no longer relevant or was resolved as a result of the upgrade and are now closing this ticket. If this issue is still a problem in your Confluence instance in version 6.15 or later, please tag me in your comment and we can reopen this ticket for review. You can read more about the editor upgrade in the 6.14 Release Notes . Thanks Makisa Appleton | Senior Product Manager, Confluence Server and Data Center

            t m added a comment - - edited

            I am seeing this same behaviour with Confluence 6.4.1. Not sure why this is marked as low priority as it means that the API is returning incorrect content - I would have thought this to be a rather important issue for an API...

            t m added a comment - - edited I am seeing this same behaviour with Confluence 6.4.1. Not sure why this is marked as low priority as it means that the API is returning incorrect content - I would have thought this to be a rather important issue for an API...

            Please keep the clever behaviour of the Rest API (no update if content is same) when fixing this bug.

            Thomas Deiler added a comment - Please keep the clever behaviour of the Rest API (no update if content is same) when fixing this bug.

            When creating the page via Rest POST instead, the JSON response does not include the wrapping div, but when pulling the page with a GET the response contains the wrapping div.

            Thomas Deiler added a comment - When creating the page via Rest POST instead, the JSON response does not include the wrapping div, but when pulling the page with a GET the response contains the wrapping div.

              Unassigned Unassigned
              gpaunovic g
              Affected customers:
              5 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: