Home/Confluence storage format reference
Confluence storage format
Superscript and subscript (sup, sub) in Confluence storage
Superscript is sup and subscript is sub. ADF has a single subsup mark with a type attribute, and both elements round-trip unchanged. The legacy service mark macro renders a superscript but is dropped by an ADF save.
Storage format
<sup>superscript</sup>
<sub>subscript</sub>
In the editor
| How | Note |
|---|---|
| Type SM, then apply the superscript formatting from the toolbar | Per the Atlassian documentation, as the replacement for the Service Mark macro. |
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<p><sup>superscript</sup></p>
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "superscript",
"type": "text",
"marks": [
{
"type": "subsup",
"attrs": {
"type": "sup"
}
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<p><sup>superscript</sup></p>Superscript as written in the storage format documentation, used for footnote marks and exponents.
Rendered view (HTML)
<p><sup>superscript</sup></p>Storage format after the round trip through ADF
<p><sup>superscript</sup></p>Sent to Confluence Cloud on .
Storage format sent
<p><sub>subscript</sub></p>Subscript as written in the storage format documentation, used for chemical formulas.
Rendered view (HTML)
<p><sub>subscript</sub></p>Storage format after the round trip through ADF
<p><sub>subscript</sub></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 sup element together with other marks in one ADF paragraph.
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
<ac:structured-macro ac:name="sm"></ac:structured-macro>The legacy service mark macro. It renders SM in a small superscript, and an ADF save replaces it with an empty paragraph.
Rendered view (HTML)
<span class=" conf-macro output-inline" data-hasbody="false" data-macro-id="<id>" data-macro-name="sm" id="">
<b> </b>
<small>
<sup id="sup-service-mark">SM</sup>
</small>
</span>Storage format after the round trip through ADF
<p />Sent to Confluence Cloud on .
What changes in conversion
- sup and sub map to the ADF subsup mark, with the attribute type set to sup or sub. Both return as the same element.
- The sm macro is not converted to a superscript. After an ADF save the storage holds an empty paragraph, so the service mark is lost.
Pitfalls
- Typing SM and formatting it as superscript is the documented replacement for the macro, so existing macro pages should be rewritten that way before editing in the Cloud editor.
- The macro in the probe had no parameters or body, so nothing in the stored markup hints that an ADF save can erase it.
Questions and answers
Is there a separate ADF mark for sub and sup?
No. Both use the subsup mark, and the type attribute holds sup or sub.
Related
- <strong>, <em>, <b> and <i>
- Entities and special characters
- Macros removed from the Cloud editor
- <code> inline code
- <small>, <big> and font size