Going Stellar

Home/Confluence storage format reference

Confluence storage format

Bold and italic (strong, em, b, i) in Confluence storage

Bold is the strong element and italic is the em element. The old b and i elements are accepted and kept as typed, but an ADF save rewrites them to strong and em. Nesting both on one run works, and the order of the two elements can change.

Storage format

<strong>strong text</strong>
<em>Italics Text</em>
<b>b tag</b> <i>i tag</i>

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

<p><strong>strong text</strong></p>
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "text": "strong text",
     "type": "text",
     "marks": [
      {
       "type": "strong"
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}

Examples

Storage format sent

<p><strong>strong text</strong></p>

Bold text exactly as the storage format documentation writes it.

Rendered view (HTML)

<p><strong>strong text</strong></p>

Storage format after the round trip through ADF

<p><strong>strong text</strong></p>

Sent to Confluence Cloud on .

Storage format sent

<p><em>Italics Text</em></p>

Italic text exactly as the storage format documentation writes it.

Rendered view (HTML)

<p><em>Italics Text</em></p>

Storage format after the round trip through ADF

<p><em>Italics Text</em></p>

Sent to Confluence Cloud on .

Storage format sent

<p><b>b tag</b> <i>i tag</i> <s>s tag</s> <del>del tag</del> <strike>strike tag</strike></p>

Legacy tags pasted from old HTML. Storage keeps b and i as typed, and the ADF round trip normalises them.

Rendered view (HTML)

<p><b>b tag</b> <i>i tag</i> <s>s tag</s> <del>del tag</del> <strike>strike tag</strike></p>

Storage format after the round trip through ADF

<p><strong>b tag</strong> <em>i tag</em> <del>s tag</del> <del>del tag</del> <del>strike tag</del></p>

Sent to Confluence Cloud on .

Storage format sent

<p><strong><em>bold italic</em></strong></p>

Both marks on the same text. The content is unchanged but the nesting order is reversed after the ADF save.

Rendered view (HTML)

<p><strong><em>bold italic</em></strong></p>

Storage format after the round trip through ADF

<p><em><strong>bold italic</strong></em></p>

Sent to Confluence Cloud on .

What changes in conversion

  • strong becomes the ADF strong mark and em becomes the em mark. Both are written back as strong and em.
  • b and i are not rejected by storage, which returns them as typed. After an ADF save they come back as strong and em, so a diff of old and new storage shows changed markup for identical formatting.
  • A strong element wrapping an em element is read as two marks on one text node. The next storage write puts em on the outside and strong on the inside.

Pitfalls

  • Compare rendered text, not markup, when checking that bold survived an editor save. The tags can be rewritten without any visible change.
  • Do not rely on the nesting order of strong and em. Tools that parse storage should treat the two orders as the same formatting.
  • Bold inside inline code is dropped by the ADF round trip, see the monospace entry.

Questions and answers

Does Confluence storage format accept b and i?

Yes, they are stored and rendered as typed. An ADF save rewrites them to strong and em.

Sources

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

Markdown version · All storage format pages