Forums

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

How can I instruct confluence to keep my JSON string containing email addresses, in the original sta

Alin Oana
Banned
September 5, 2025

 

Currently when I paste in a confluence doc a string which contains email addresses, Confluence is automatically formatting that string to highlight those addresses. This is achieved by adding anchor <a> html tags on top of my original string. 

This is ok as long as you just use the UI, but if you have to use the confluence APIs to get that content, you get into troubles.

The content retuned by confluence APIs will also contain those styling elements. In case of a JSON string that is a huge problem as you won't be able to parse that string as a JSON anymore. 

My original string:

 

{"live":{"sendFromEmail":"test@test.com","sendToCCEmails": ["testdev@test.com","testhelp@test.com"],"sendToEmail": "help@test.com"},"test": {"sendFromEmail": "testhelp@test.com","sendToCCEmails": ["testdev@test.com"],"sendToEmail": "bla@test.com"}}

 

Confluence API returned string:

{&quot;live&quot;:{&quot;<a href=\"mailto:sendFromEmail%22:%22test@test.com\">sendFromEmail&quot;:&quot;test@test.com</a>&quot;,&quot;sendToCCEmails&quot;: [&quot;<a href=\"mailto:testdev@test.com\">testdev@test.com</a>&quot;<a>,&quot;testhelp@test.com</a>&quot;],&quot;sendToEmail&quot;: &quot;<a href=\"mailto:help@test.com\">help@test.com</a>&quot;},&quot;test&quot;: {&quot;sendFromEmail&quot;: &quot;<a href=\"mailto:testhelp@test.com\">testhelp@test.com</a>&quot;,&quot;sendToCCEmails&quot;: [&quot;<a href=\"mailto:testdev@test.com\">testdev@test.com</a>&quot;],&quot;sendToEmail&quot;: &quot;<a href=\"mailto:bla@test.com\">bla@test.com</a>&quot;}}

 

Confluence view:

json.png

 

So my question is: how can I instruct confluence to present this string in the original format? Or how can I fetch from confluence the original content (no enhancements.) ?

 

 

1 answer

1 accepted

0 votes
Answer accepted
Marc - Devoteam
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 5, 2025

Hi @Alin Oana 

Hi when pasting the text on a page, you should see an option under the pasted text, where you can select to set the pasted information as Plain Text

This prevents the setting of html encoding.

Or store the information into a code block set as JSON, this should preserve your code.

 

Alin Oana
Banned
September 5, 2025

@Marc - Devoteam thanks for the answer. I am actually pasting that text in a table cell. At that level the option you are talking about is not available, or at least I am not seeing/finding it at that level

Marc - Devoteam
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 5, 2025

Hi @Alin Oana 

Indeed in a table or layout this option is not available only when pasting directly on the page.

So in a table or layout, your only option would be to use the code snippet macro

Alin Oana
Banned
September 5, 2025

Thank you! Using a macro is not clean for my scenario, but it seems to be working.

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events