Home/Confluence storage format reference
Confluence storage format
Inline code (code element) in Confluence storage format
Inline monospace text is the code element. It maps to the ADF code mark and returns unchanged. Other marks inside it are not kept, which shows when bold text is wrapped in code.
Storage format
<code>monospaced</code>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<p><code>monospaced</code></p>
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "monospaced",
"type": "text",
"marks": [
{
"type": "code"
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<p><code>monospaced</code></p>Inline code as written in the storage format documentation, for file names and short commands.
Rendered view (HTML)
<p><code>monospaced</code></p>Storage format after the round trip through ADF
<p><code>monospaced</code></p>Sent to Confluence Cloud on .
Storage format sent
<p><code><strong>bold code</strong></code></p>Bold text inside code. Storage keeps both elements, but the ADF read-back carries only the code mark.
Rendered view (HTML)
<p><code><strong>bold code</strong></code></p>Storage format after the round trip through ADF
<p><code>bold code</code></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}The code mark inside a paragraph that also carries bold, underline, strike, superscript, colour and highlight marks.
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 .
What changes in conversion
- code maps to the ADF code mark and is written back as code.
- A strong element inside code is stored as written, yet the generated ADF has only the code mark. After an ADF save the text is monospace but no longer bold.
Pitfalls
- Do not expect emphasis inside a code span to survive an editor save. Put the emphasis outside the code element or drop it.
- code is an inline element. A multi-line block needs the preformatted entry or the code macro.
Questions and answers
Can inline code be bold in Confluence Cloud?
Not after an ADF save. The probe wrapping strong inside code came back as code only.