Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting http Error 400, when uploading confluence page with CDATA section

zaphnet
Contributor
February 18, 2019

Trying to add a confluence page with a PlantUML macro.

I can generate other pages and attachments, but when I try to generate this page I get an error.

Trying to create simple Graphviz graph.

...
<p></p>
<ac:structured-macro ac:macro-id="09a43cf2-3de2-4164-b4d5-c9b8f7afd1e8" ac:name="plantuml" ac:schema-version="1">
<ac:parameter ac:name="format">SVG</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:plain-text-body><![CDATA[digraph R {
node [shape=record];
a -> b
}]]></ac:plain-text-body>
</ac:structured-macro>
<p></p>
...

The idea is to generate confluence pages with generated visualizations.

If I paste this code into the "<>" HTML Editor it is resolved correctly.

uploading with REST API

page.Body.Storage.Value = getBodyFromFile(filepath, bodyOnly, stripImgs)
c.doRequest("PUT", "/rest/api/content/"+ID, page, response)

Successful with many other examples (structured macros).

Not sure why this file fails. Could it be some parsing or missing escaping of the CDATA section?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events