Page creating erring on non-escaped HTML entities.

I have a bit of a problem uploading content using the API. I finally figured out that it throws errors when the content hasn't been escaped with HTML entities, however, now that I'm escaping the content, it displays the html entities in the content (also in part because I'm wrapping this content in a code macro which displays the content in a CDATA text element). 

CONTENT="grep this /in/file && echo y"
CONTENT="grep this /in/file \&\& echo y"
CONTENT="grep this /in/file && echo y"

curl --netrc
-H 'Content-Type: application/json' -d'{"type":"page","title":"new page", "ancestors":[{"id":456}], "space":{"key":"TST"},"body":{"storage":{"value":"<p>'$CONTENT'</p>","representation":"storage"}}}' https://confluence/wiki/rest/api/content/

The first CONTENT variable causes the api call to fail. The second and third work, however, they display \& and &amp; on the page (in the code macro content).

I understand this is a very small and specific issue, but can someone offer some suggestions for how I need to change the request so it displays the unescaped html entities on the page?

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

280 views 2 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you