Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-76274

Rendering a date macro via /wiki/rest/api/contentbody/convert/view generates incorrect HTML compared to view mode

    XMLWordPrintable

Details

    Description

      Issue Summary

      When using the REST API /wiki/rest/api/contentbody/convert/view documented in

      with the payload of storage format of 

       <time datetime="2023-07-31" />

      it will generate the different HTML to what is seen normally.

      As a result, any Dynamic Macros in Connect that use this endpoint do not display Date macros the same way as a regular page.

      Australian/UK Date Format

      German Format

      US Format

      Note, that in edit mode Date macro appears correct

      It works for Status macro and @ mentions.

      Steps to Reproduce

      1. Call the convert REST API with a payload of a Date macro storage format
        $ curl --silent \
        --user <email>:<token> \
        --request POST \
        --url 'https://mycompany.atlassian.net/wiki/rest/api/contentbody/convert/view' \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data-raw '{"value":"<time datetime=\"2023-07-31\" />", "representation": "storage" }'
        

      Expected Results

      The HTML value output should be (For Australia/UK format)

      <span class="date-lozenger-container">
        <span class="date-node" data-node-type="date" data-timestamp="1690761600000">31 Jul 2023</span>
      </span>
      

      Actual Results

      The HTML value output is

      <time datetime="2023-07-31" class="date-upcoming">31 Jul 2023</time>
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        1. Deutsch.png
          Deutsch.png
          16 kB
        2. English (US).png
          English (US).png
          20 kB
        3. image-2023-08-03-14-43-21-985.png
          image-2023-08-03-14-43-21-985.png
          19 kB
        4. image-2023-08-03-14-43-47-025.png
          image-2023-08-03-14-43-47-025.png
          19 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrichards@atlassian.com James Richards
              Votes:
              11 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: