Forums

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

Ignore whitespace while updating page through API

DDDsa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2021 edited

I recently switched to Conflunce Cloud and now when I update page through API all whitespaces that exist in storage representation I am sending to Confluence are preserved in the page.

 

Here's an example. I send this page content through API:

 

<p>
word1
word2
word3
</p>
<p>word3<ac:structured-macro ac:name="anchor" ac:schema-version="1"><ac:parameter ac:name="">myanchor</ac:parameter></ac:structured-macro>word4</p>

I expect content inside <p> block to be treated as HTML, so all whitespace formatting should be collapsed. This is the content I expect to see on the page:

word1 word2 word3
word3word4

But all whitespaces are preserved and this is what I get:

Screenshot 2021-12-15 at 10.04.03.png

 

It added spaces before word1, word2, word3 and newlines after them. It also added a space on the place of invisible anchor macro.

This is very tedious to clean up while preparing the page content to send. Is it possible to turn off such strange whitespace behavior? I never had such problem when working with Confluence Server.

1 answer

0 votes
Akbar Gulaliyev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2023

Don't know will it help in your case or not, but you can try add invisible characters (press alt+255)

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events