Going Stellar

Home/Confluence storage format reference

Confluence storage format

Underline (u) in Confluence storage format

Underline is the u element. Storage keeps it as written, ADF represents it as an underline mark, and the round trip returns the same element.

Storage format

<u>underline</u>

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

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

Examples

Storage format sent

<p><u>underline</u></p>

Underlined text as written in the storage format documentation.

Rendered view (HTML)

<p><u>underline</u></p>

Storage format after the round trip through ADF

<p><u>underline</u></p>

Sent to Confluence Cloud on .

Storage format sent

ADF:{"content": [{"content": [{"marks": [{"type": "strong"}], "text": "b", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "underline"}], "text": "u", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "strike"}], "text": "s", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "code"}], "text": "c", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"type": "sup"}, "type": "subsup"}], "text": "sup", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"color": "#ff5630"}, "type": "textColor"}], "text": "red", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"color": "#fedec8"}, "type": "backgroundColor"}], "text": "hl", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}

An ADF paragraph with seven different marks. The underline mark is written as u next to strong, del, code, sup and two span styles.

Rendered view (HTML)

<p><style>[data-colorid=ygsqugo5p0]{color:#ff5630} html[data-color-mode=dark] [data-colorid=ygsqugo5p0]{color:#cf2600}</style><strong>b</strong> <u>u</u> <del>s</del> <code>c</code> <sup>sup</sup> <span data-colorid="ygsqugo5p0">red</span> <span style="background-color: rgb(254,222,200);">hl</span></p>

Storage format after the round trip through ADF

<p><strong>b</strong> <u>u</u> <del>s</del> <code>c</code> <sup>sup</sup> <span style="color: rgb(255,86,48);">red</span> <span style="background-color: rgb(254,222,200);">hl</span></p>

Sent to Confluence Cloud on .

Storage format sent

<p><span style="text-decoration: line-through;">strikethrough</span></p>

Contrast case. A text-decoration span is not an ADF mark, so the same span form for underline cannot be assumed to survive an editor save.

Rendered view (HTML)

<p><span style="text-decoration: line-through;">strikethrough</span></p>

Storage format after the round trip through ADF

<p>strikethrough</p>

Sent to Confluence Cloud on .

What changes in conversion

  • u maps one to one to the ADF underline mark and comes back as u.
  • The u element carries no style attribute, unlike the documented strikethrough span, and it came back unchanged.

Pitfalls

  • Underline set through a CSS style was not probed, so only the u element is covered by these examples.
  • A multi-mark paragraph can be written in storage and read back with every mark intact, as the second example shows.

Questions and answers

Does an ADF save keep the u element?

Yes. It is stored as an underline mark and written back as u.

Sources

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

Markdown version · All storage format pages