Code macro is not rendered when exporting by /contentbody/convert/export_view

Code macro loses its content when exporting it using REST API /contentbody/convert/export_view. Sending this

<ac:structured-macro ac:name="code" ac:schema-version="1" ac:macro-id="c3d51124-703a-489d-934b-75c66cff0b3a"><ac:plain-text-body><!--[CDATA[.refresh-issues-bottom { display: none; }]]--></ac:plain-text-body></ac:structured-macro>

I get this

<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">↵<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Confluence" data-theme="Confluence"></pre>↵</div></div>

What should I do to export the Code macro correctly?

1 Like

Hi @akhaneev ,

The content of the <ac:plain-text-body> tag looks like a HTML comment:

<!--[CDATA[.refresh-issues-bottom { display: none; }]]-->

Can you share where this came from. If the content of the code macro contained a comment, it should be within the CDATA block.

If you change your query so that the content of the <ac:plain-text-body> tag is as follows, then I think the content of the code block will be returned:

<![CDATA[.refresh-issues-bottom { display: none; }]]>


1 Like