-
Type:
Bug
-
Resolution: Timed out
-
Priority:
Medium
-
Component/s: Collaboration - Comments, Ecosystem
-
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:
- Create a page called "Test" in a space.
- Get the ID of another page in that space.
- 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"} } - The returned HTML will contain the code example and the link text is the customized text from the storage format
- 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"} } - Now the code macro content is lost and the link text simply matches the title of the target page instead of the adapted text.