Text without CDATA in macro plain-text-body and link plain-text-link-body is lost during conversion

XMLWordPrintable

    • Severity 3 - Minor

      When converting storage to export view using /rest/api/contentbody/convert/export_view all plain-text-body and plain-text-link-body tags require a CDATA tag inside them in order not to loose their content during conversion.

      Steps to reproduce:

      1. Create a page called "Test" in a space.
      2. Get the ID of another page in that space.
      3. Send this JSON to the convert service (adapt the content ID to match the ID of the other page):
        POST .../rest/api/contentbody/convert/export_view
        {
            "value" : "<ac:structured-macro ac:name=\"code\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"><ac:plain-text-body><![CDATA[some code in here]]></ac:plain-text-body></ac:structured-macro><p><ac:link><ri:page ri:content-title=\"Test\" /><ac:plain-text-link-body><![CDATA[Link to Test]]></ac:plain-text-link-body></ac:link></p>",
            "representation" : "storage",
          	"content":{"id":"10190856"}
        }
        
      4. The returned HTML will contain the code example and the link text is the customized text from the storage format
      5. Now remove the CDATA tags from the storage format, preserving their content and convert that again. Here's the adapted code:
        POST .../rest/api/contentbody/convert/export_view
        {
            "value" : "<ac:structured-macro ac:name=\"code\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"><ac:plain-text-body>some code in here</ac:plain-text-body></ac:structured-macro><p><ac:link><ri:page ri:content-title=\"Test\" /><ac:plain-text-link-body>Link to Test</ac:plain-text-link-body></ac:link></p>",
            "representation" : "storage",
          	"content":{"id":"10190856"}
        }
        
      6. Now the code macro content is lost and the link text simply matches the title of the target page instead of the adapted text.

            Assignee:
            Unassigned
            Reporter:
            Jens Henrik Jens Henrik
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: