Going Stellar

Home/Confluence storage format reference

Confluence storage format

HTML that Confluence storage format drops

Storage format is not general HTML. Comments, script elements and unknown heading levels are removed at save. A font tag or a div is stored, but the ADF round trip flattens it. The html macro is not rendered as HTML.

Examples

Storage format sent

<p><font color="red">font tag</font></p>

Old presentational markup. It is stored and rendered, but it has no ADF form.

Rendered view (HTML)

<p><font color="red">font tag</font></p>

Storage format after the round trip through ADF

<p>font tag</p>

Sent to Confluence Cloud on .

Storage format sent

<div><p>in a div</p></div>

A generic wrapper. Storage keeps it, and an ADF save unwraps it to a plain paragraph.

Rendered view (HTML)

<div><p>in a div</p></div>

Storage format after the round trip through ADF

<p>in a div</p>

Sent to Confluence Cloud on .

Storage format sent

<p>a<!-- comment -->b</p>

An HTML comment. It is removed at save time, so the text reads ab in storage and in the view.

Rendered view (HTML)

<p>ab</p>

Storage format after the round trip through ADF

<p>ab</p>

Sent to Confluence Cloud on .

Storage format sent

<p><script>alert(1)</script>after script</p>

A script element. Confluence removes it together with its content at save time.

Rendered view (HTML)

<p>after script</p>

Storage format after the round trip through ADF

<p>after script</p>

Sent to Confluence Cloud on .

Storage format sent

<h7>Heading 7</h7>

An element outside the supported set. The tag is removed and the text is kept without a wrapper.

Rendered view (HTML)

Heading 7

Storage format after the round trip through ADF

<p>Heading 7</p>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="html"><ac:plain-text-body><![CDATA[<b>raw html</b>]]></ac:plain-text-body></ac:structured-macro>

The html macro. Storage keeps the body, and the view shows the unknown macro placeholder rather than the bold text.

Rendered view (HTML)

<img class="wysiwyg-unknown-macro" src="https://your-site.atlassian.net/wiki/plugins/servlet/confluence/placeholder/unknown-macro?name=html&amp;locale=en_US&amp;version=2" />

Storage format after the round trip through ADF

<ac:structured-macro ac:name="html" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="_parentId"><page id></ac:parameter><ac:plain-text-body><![CDATA[<b>raw html</b>]]></ac:plain-text-body></ac:structured-macro>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="style"><ac:rich-text-body><p>style body</p></ac:rich-text-body></ac:structured-macro>

The style macro with a rich text body. Storage keeps the macro but stores no body, and the view has an empty style block.

Rendered view (HTML)

<style class="conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="style">@media all {

}</style>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="style" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="_parentId"><page id></ac:parameter></ac:structured-macro>

Sent to Confluence Cloud on .

What changes in conversion

  • Removal happens in two places. Comments, script and unknown tags go at save time. Presentational tags such as font, div, small, big and font-size spans survive that save and go in the next ADF round trip.
  • The ADF round trip unwraps a div to its paragraph and removes a font element, in both cases keeping the text.
  • The html macro keeps its body in storage and in ADF, and the view does not render it as HTML. The macro gained a _parentId parameter after the ADF round trip.
  • A rich text body sent to the style macro is not stored. The macro comes back empty even before the ADF save.

Pitfalls

  • A save that succeeds does not mean the markup was kept. Read the page back and compare before relying on any non-documented element.
  • Script content is removed along with the element, so any text inside it is lost too.
  • Do not use the html macro to inject markup into a Cloud page. The body is stored, and the view shows a placeholder.

Questions and answers

Which HTML elements does Confluence storage format keep?

The elements in the storage format documentation, such as p, h1 to h6, strong, em, ul, ol, table and blockquote. Others were stored or removed depending on the element, see the examples.

Sources

  1. Confluence storage format (Atlassian Documentation)
  2. Atlassian Document Format: document structure (Atlassian Developer)
  3. Macros that are unavailable or have limited availability in the Cloud editor (Atlassian Support)

Markdown version · All storage format pages