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:
{"live":{"<a href=\"mailto:sendFromEmail%22:%22test@test.com\">sendFromEmail":"test@test.com</a>","sendToCCEmails": ["<a href=\"mailto:testdev@test.com\">testdev@test.com</a>"<a>,"testhelp@test.com</a>"],"sendToEmail": "<a href=\"mailto:help@test.com\">help@test.com</a>"},"test": {"sendFromEmail": "<a href=\"mailto:testhelp@test.com\">testhelp@test.com</a>","sendToCCEmails": ["<a href=\"mailto:testdev@test.com\">testdev@test.com</a>"],"sendToEmail": "<a href=\"mailto:bla@test.com\">bla@test.com</a>"}}
Confluence view:
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.) ?
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.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.