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

Using <ri:attachment> when updating page using API with /n will cause error

    XMLWordPrintable

Details

    Description

      Issue Summary

      A partner has reported an issue with <ri:attachment> when updating a page through the API ( /rest/api/content/<id>).

      • When opening and closing the <ri:attachment>  tag in the same line, there are not issues and it works as expected.
      • When opening <ri:attachment> in one line and closing it in a different line, it throws StorageUnmarshalXhtmlException

      Steps to Reproduce

      1. Using API to update confluence page
        example:
        { "type": "page", "version": \\{ "number": 3 },
        "title": "Attachments",
        "status": "historical",
        "body": {
        "storage":{ "representation": "storage", "value": "<ac:image ac:align=\"center\" ac:layout=\"center\" ac:original-height=\"600\" ac:original-width=\"1200\">\n <ri:attachment ri:filename=\"cat.png\" ri:version-at-save=\"1\">\n </ri:attachment>\n</ac:image>\n<p />" }
        }
        

      Expected Results

      Update success

      Actual Results

      HTTP 500 error
       

      Workaround

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              2797cdbebccd zhikun xu
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: