Going Stellar

Home/Confluence storage format reference

Confluence storage format

Smart links: inline, card and embed in storage format

A smart link is a normal a href whose data-card-appearance attribute says how to show it: inline, block or embed. The ADF side has inlineCard, blockCard and embedCard nodes. The three forms did not convert alike, and the embed form returned as an unsupported-content extension.

Storage format

<a href="https://example.com" data-card-appearance="inline">https://example.com</a>
<a href="https://example.com" data-card-appearance="block">https://example.com</a>
<a href="https://example.com" data-card-appearance="embed">https://example.com</a>

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

ADF:{"content": [{"content": [{"attrs": {"url": "https://example.com"}, "type": "inlineCard"}], "type": "paragraph"}], "type": "doc", "version": 1}
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "inlineCard",
     "attrs": {
      "url": "https://example.com"
     }
    }
   ]
  }
 ],
 "version": 1
}

Examples

Storage format sent

<p><a href="https://example.com" data-card-appearance="inline">https://example.com</a></p>

A link shown as an inline card, in the middle of a sentence.

Rendered view (HTML)

<p><a class="external-link" data-card-appearance="inline" href="https://example.com" rel="nofollow">https://example.com</a></p>

Storage format after the round trip through ADF

<p><a href="https://example.com" data-card-appearance="inline">https://example.com</a></p>

Sent to Confluence Cloud on .

Storage format sent

<p><a href="https://example.com" data-card-appearance="block">https://example.com</a></p>

The same address as a block card on its own line.

Rendered view (HTML)

<p><a class="external-link" data-card-appearance="block" href="https://example.com" rel="nofollow">https://example.com</a></p>

Storage format after the round trip through ADF

<a href="https://example.com" data-card-appearance="block">https://example.com</a>

Sent to Confluence Cloud on .

Storage format sent

<p><a href="https://example.com" data-card-appearance="embed">https://example.com</a></p>

The same address as an embed, which shows the page inside the page.

Rendered view (HTML)

<p><a class="external-link" data-card-appearance="embed" href="https://example.com" rel="nofollow">https://example.com</a></p>

Storage format after the round trip through ADF

<p><a href="https://example.com" data-card-appearance="embed">https://example.com</a></p>

Sent to Confluence Cloud on .

Storage format sent

ADF:{"content": [{"content": [{"attrs": {"url": "https://example.com"}, "type": "inlineCard"}], "type": "paragraph"}], "type": "doc", "version": 1}

An inlineCard node sent as ADF, to see the storage Confluence writes.

Rendered view (HTML)

<p><a class="external-link" data-card-appearance="inline" href="https://example.com" rel="nofollow">https://example.com</a></p>

Storage format after the round trip through ADF

<p><a href="https://example.com" data-card-appearance="inline">https://example.com</a></p>

Sent to Confluence Cloud on .

Storage format sent

ADF:{"content": [{"attrs": {"url": "https://example.com"}, "type": "blockCard"}], "type": "doc", "version": 1}

A blockCard node sent as ADF, which Confluence stores without a paragraph.

Rendered view (HTML)

<a class="external-link" data-card-appearance="block" href="https://example.com" rel="nofollow">https://example.com</a>

Storage format after the round trip through ADF

<a href="https://example.com" data-card-appearance="block">https://example.com</a>

Sent to Confluence Cloud on .

Storage format sent

ADF:{"content": [{"attrs": {"layout": "center", "url": "https://example.com"}, "type": "embedCard"}], "type": "doc", "version": 1}

An embedCard node with a layout, which stores the layout as data-layout.

Rendered view (HTML)

<a class="external-link" data-card-appearance="embed" data-layout="center" href="https://example.com" rel="nofollow">https://example.com</a>

Storage format after the round trip through ADF

<a href="https://example.com" data-layout="center" data-card-appearance="embed">https://example.com</a>

Sent to Confluence Cloud on .

What changes in conversion

  • The inline form round-trips both ways: data-card-appearance="inline" and the ADF inlineCard node are the same thing.
  • A block card is stored as an a element placed directly in the body with no paragraph around it. The storage-to-ADF conversion of the block form with a paragraph also drops that paragraph.
  • The embed form written in storage was read as an extension node named unsupported content, which holds the original markup and a nested embedCard, and returned unchanged. ADF sent as embedCard stores data-layout and data-card-appearance.
  • The ADF card nodes carry only the address, so the text between the a tags is not a separate field in the ADF form.

Pitfalls

  • The view of a card is a plain external link, so the card look appears only in the editor, not in the stored HTML.
  • An embed written in storage is read by the converter as unsupported content, so the Cloud editor may not offer it as an embed.
  • A block card stored with a paragraph around it and one stored without are different markup that the rendered view treats alike.

Sources

  1. Confluence storage format (Atlassian Documentation)
  2. Atlassian Document Format: document structure (Atlassian Developer)

Markdown version · All storage format pages