Home/Confluence storage format reference
Confluence storage format
<ul> and <ol> lists in Confluence storage format
A bulleted list is a ul element and a numbered list is an ol element, with one li per item and no ac: elements. A save from the Cloud editor wraps every item in a paragraph and adds start="1" to numbered lists. The ol start attribute is kept and maps to the ADF order attribute.
Storage format
<ul>
<li>round bullet list item</li>
</ul>
<ol>
<li>numbered list item</li>
</ol>
<ol start="3"><li>starts at three</li></ol>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<ul><li>round bullet list item</li></ul>
{
"type": "doc",
"content": [
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "round bullet list item",
"type": "text"
}
]
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<ul><li>round bullet list item</li></ul>A bulleted list in its simplest form, the one the storage format page documents.
Rendered view (HTML)
<ul><li>round bullet list item</li></ul>Storage format after the round trip through ADF
<ul><li><p>round bullet list item</p></li></ul>Sent to Confluence Cloud on .
Storage format sent
<ol><li>numbered list item</li></ol>A numbered list in its simplest form.
Rendered view (HTML)
<ol><li>numbered list item</li></ol>Storage format after the round trip through ADF
<ol start="1"><li><p>numbered list item</p></li></ol>Sent to Confluence Cloud on .
Storage format sent
<ol start="3"><li>starts at three</li></ol>A numbered list that has to continue from an earlier list instead of restarting at one.
Rendered view (HTML)
<ol start="3"><li>starts at three</li></ol>Storage format after the round trip through ADF
<ol start="3"><li><p>starts at three</p></li></ol>Sent to Confluence Cloud on .
Storage format sent
<ul style="list-style-type: square;"><li>square</li></ul>Trying to get square bullets with an inline list-style-type on the ul.
Rendered view (HTML)
<ul style="list-style-type: square;"><li>square</li></ul>Storage format after the round trip through ADF
<ul><li><p>square</p></li></ul>Sent to Confluence Cloud on .
Storage format sent
<ul><li><p>paragraph in li</p></li></ul>A list item that already holds a paragraph, the shape the Cloud editor writes itself.
Rendered view (HTML)
<ul><li><p>paragraph in li</p></li></ul>Storage format after the round trip through ADF
<ul><li><p>paragraph in li</p></li></ul>Sent to Confluence Cloud on .
Storage format sent
<ul><li>item<br />second line</li></ul>A manual line break inside one list item without starting a new item.
Rendered view (HTML)
<ul><li>item<br/>second line</li></ul>Storage format after the round trip through ADF
<ul><li><p>item<br />second line</p></li></ul>Sent to Confluence Cloud on .
Storage format sent
ADF:{"content": [{"attrs": {"order": 3}, "content": [{"content": [{"content": [{"text": "three", "type": "text"}], "type": "paragraph"}], "type": "listItem"}], "type": "orderedList"}], "type": "doc", "version": 1}A numbered list sent as ADF with order 3, to see the start value Confluence writes.
Rendered view (HTML)
<ol start="3"><li><p>three</p></li></ol>Storage format after the round trip through ADF
<ol start="3"><li><p>three</p></li></ol>Sent to Confluence Cloud on .
What changes in conversion
- Items with bare text come back with the text wrapped in a paragraph after an ADF save, so a ul item turns into li containing p. The visible list is the same.
- An ol with no start attribute comes back with start="1". The ol start value is kept and is the ADF orderedList order attribute.
- The inline list-style-type on a ul is stored and rendered as sent, but the ADF form has no field for it, so an editor save drops the style attribute and the bullets return to the default.
- A br inside an item becomes a hardBreak node and returns as br, inside the paragraph the save adds.
Pitfalls
- Do not rely on a list-style-type or any other inline style on ul or ol. It survives a REST write but not the next save from the Cloud editor.
- Text sitting directly in an li and text inside a p in the li are the same list after conversion, so compare lists by their text, not by the exact markup.
- To continue numbering, set start on the ol. The same value is the ADF order attribute, and a start of 3 was kept in both directions.
Questions and answers
Does a numbered list need a start attribute?
No. Without it the list begins at one, and a save from the Cloud editor writes start="1" for you.
Related
- Nested and mixed lists
- <ac:task-list> task lists
- Paragraphs, line breaks and <hr>
- Lists, paragraphs and tables in cells