Home/Confluence storage format reference
Confluence storage format
Paragraphs, line breaks and hr in Confluence storage
A paragraph is a p element, a line break is br and a horizontal rule is hr. They map to the ADF paragraph, hardBreak and rule nodes. Text outside any paragraph is accepted by storage, and an ADF save wraps it in p.
Storage format
<p>Paragraph 1</p><p>Paragraph 2</p>
<p>Line 1 <br /> Line 2</p>
<hr />
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<p>Line 1 <br /> Line 2</p>
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Line 1 ",
"type": "text"
},
{
"type": "hardBreak"
},
{
"text": " Line 2",
"type": "text"
}
]
}
],
"version": 1
}
Examples
Storage format sent
<p>Paragraph 1</p><p>Paragraph 2</p>Two paragraphs as the documentation shows. Each is its own ADF paragraph node.
Rendered view (HTML)
<p>Paragraph 1</p><p>Paragraph 2</p>Storage format after the round trip through ADF
<p>Paragraph 1</p><p>Paragraph 2</p>Sent to Confluence Cloud on .
Storage format sent
<p>Line 1 <br /> Line 2</p>A line break inside one paragraph. The spaces around br stay in the text on both sides.
Rendered view (HTML)
<p>Line 1 <br/> Line 2</p>Storage format after the round trip through ADF
<p>Line 1 <br /> Line 2</p>Sent to Confluence Cloud on .
Storage format sent
<hr />A horizontal rule. The view renders it as a self-closing element and ADF calls it rule.
Rendered view (HTML)
<hr/>Storage format after the round trip through ADF
<hr />Sent to Confluence Cloud on .
Storage format sent
bare text without paragraphText sent with no wrapper element. Storage keeps it bare, and the ADF save adds a paragraph.
Rendered view (HTML)
bare text without paragraphStorage format after the round trip through ADF
<p>bare text without paragraph</p>Sent to Confluence Cloud on .
What changes in conversion
- p maps to paragraph, br to hardBreak and hr to rule. All three come back in the same form.
- Whitespace around a br is part of the text. The ADF text nodes keep Line 1 with a trailing space and Line 2 with a leading space.
- Bare text is not wrapped on a storage save. It is wrapped only when the content has been through ADF.
Pitfalls
- Use separate p elements for paragraph spacing. A br gives a line break without the paragraph gap.
- Bare text works in storage, but tools that expect every block to be an element see two shapes of the same page.
- The documentation notes that a line break is created in the editor with Shift and Enter.
Questions and answers
How do I add a line break in storage format?
Use a br element inside a paragraph, written as <br />.
Related
- <h1> to <h6> headings
- <blockquote>
- Entities and special characters
- Alignment and indentation
- <ul> and <ol> lists